-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
58 lines (55 loc) · 1.5 KB
/
docker-compose.yml
File metadata and controls
58 lines (55 loc) · 1.5 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
57
58
services:
postgres:
image: postgres:16-alpine
container_name: taskflow-postgres
environment:
POSTGRES_DB: ${POSTGRES_DB}
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
ports:
- "${DB_PORT}:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
interval: 5s
timeout: 5s
retries: 10
migrate:
image: migrate/migrate:v4.17.1
container_name: taskflow-migrate
depends_on:
postgres:
condition: service_healthy
volumes:
- ./backend/migrations:/migrations:ro
command:
[
"-path",
"/migrations",
"-database",
"postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB}?sslmode=disable",
"up"
]
restart: "no"
api:
build:
context: ./backend
dockerfile: Dockerfile
container_name: taskflow-api
depends_on:
migrate:
condition: service_completed_successfully
environment:
DB_URL: jdbc:postgresql://postgres:5432/${POSTGRES_DB}
DB_USER: ${POSTGRES_USER}
DB_PASSWORD: ${POSTGRES_PASSWORD}
JWT_SECRET: ${JWT_SECRET}
JWT_TTL_HOURS: ${JWT_TTL_HOURS}
LOGIN_RATE_LIMIT_CAPACITY: ${LOGIN_RATE_LIMIT_CAPACITY}
LOGIN_RATE_LIMIT_REFILL_MINUTES: ${LOGIN_RATE_LIMIT_REFILL_MINUTES}
SERVER_PORT: 8080
ports:
- "${API_PORT}:8080"
volumes:
postgres_data: