-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompose.yaml
More file actions
56 lines (55 loc) · 2.38 KB
/
compose.yaml
File metadata and controls
56 lines (55 loc) · 2.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
services: #docker comppse expects
backend: # custom key name
# image: python:latest
build: # docker compose up --build
context: ./backend # path to the directory where the Dockerfile is located
dockerfile: Dockerfile
ports:
- "8080:8000"
command: uvicorn main:app --host 0.0.0.0 --port 8000
# environment variables are run time variables, if you don't care if some one can see them put them in the envrionment section
environment:
- PORT=8000
- MY_PROJ=Agentic AI
# if you care about security and don't want to put your environment variables in the docker compose file and will be injected at runtime, you can put them in a .env file and then reference that file in the docker compose file
env_file:
- .env.sample
volumes:
- ./backend/src:/app
depends_on:
- db_service
develop:
watch:
- action: rebuild
path: backend/requirements.txt
- action: rebuild
path: backend/Dockerfile
- action: restart
path: backend/src/
# database_url=postgresql+psycopg://db_user:db_password@db_service:5432/db_name
db_service:
image: postgres:17
ports:
- 5432:5432
environment:
- POSTGRES_USER=db_user
- POSTGRES_PASSWORD=db_password
- POSTGRES_DB=db_name
# env_file:
# - ./env.sample-db
volumes:
- dc_managed_db_volume:/var/lib/postgresql/data # this is a docker managed volume, it will persist even if the container is deleted, and it will be automatically created by docker when the container is run for the first time. You can also create it manually using the command "docker volume create dc_managed_db_volume"
# static_html: # custom key name
# # image: python:latest
# build: # docker compose up --build
# context: ./static_html # path to the directory where the Dockerfile is located
# dockerfile: static.Dockerfile
# ports:
# - "2000:8000"
# - "3000:8000"
# - "8000:8000"
# command: python -m http.server 8000
# volumes:
# - ./static_html/src:/app
volumes:
dc_managed_db_volume: # docker managed volume