-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
44 lines (41 loc) · 1.17 KB
/
Copy pathdocker-compose.yml
File metadata and controls
44 lines (41 loc) · 1.17 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
services:
db:
image: postgres:16
container_name: etime_db
environment:
POSTGRES_DB: ${POSTGRES_DB:-etime}
POSTGRES_USER: ${POSTGRES_USER:-etime}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?Set POSTGRES_PASSWORD in a root .env file before running docker compose}
volumes:
- db_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U \"$${POSTGRES_USER}\" -d \"$${POSTGRES_DB}\""]
interval: 10s
timeout: 5s
retries: 5
backend:
build:
context: ./backend
container_name: etime_backend
env_file: ./backend/.env
environment:
DATABASE_URL: postgresql+psycopg2://${POSTGRES_USER:-etime}:${POSTGRES_PASSWORD:?Set POSTGRES_PASSWORD in a root .env file before running docker compose}@db:5432/${POSTGRES_DB:-etime}
depends_on:
db:
condition: service_healthy
ports:
- "8001:8001"
restart: unless-stopped
frontend:
build:
context: ./frontend
container_name: etime_frontend
environment:
API_PROXY_TARGET: http://backend:8001
depends_on:
- backend
ports:
- "3000:3000"
restart: unless-stopped
volumes:
db_data: