Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
57 lines (53 loc) · 1.62 KB
/
Copy pathdocker-compose.yml
File metadata and controls
57 lines (53 loc) · 1.62 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:
postgres:
image: postgres:16-alpine
restart: unless-stopped
environment:
POSTGRES_DB: ${POSTGRES_DB:-taskflow}
POSTGRES_USER: ${POSTGRES_USER:-taskflow}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-taskflow_password}
volumes:
- pg_data:/var/lib/postgresql/data
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-taskflow} -d ${POSTGRES_DB:-taskflow}"]
interval: 5s
timeout: 5s
retries: 10
api:
build:
context: ./backend
dockerfile: Dockerfile
restart: unless-stopped
depends_on:
postgres:
condition: service_healthy
environment:
SPRING_DATASOURCE_URL: ${SPRING_DATASOURCE_URL:-jdbc:postgresql://postgres:5432/taskflow}
SPRING_DATASOURCE_USERNAME: ${POSTGRES_USER:-taskflow}
SPRING_DATASOURCE_PASSWORD: ${POSTGRES_PASSWORD:-taskflow_password}
JWT_SECRET: ${JWT_SECRET:-change_me_to_a_very_long_random_secret_at_least_32_chars}
CORS_ALLOWED_ORIGINS: ${CORS_ALLOWED_ORIGINS:-http://localhost:3000,http://localhost:5173}
SPRING_PROFILES_ACTIVE: prod
ports:
- "8080:8080"
healthcheck:
test: ["CMD-SHELL", "wget -qO- http://localhost:8080/actuator/health | grep -q '\"status\":\"UP\"' || exit 1"]
interval: 10s
timeout: 5s
retries: 10
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
args:
VITE_API_URL: ${VITE_API_URL:-http://localhost:8080}
restart: unless-stopped
depends_on:
api:
condition: service_healthy
ports:
- "3000:80"
volumes:
pg_data: