forked from medods/test-task-for-junior-backend-developer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
35 lines (32 loc) · 917 Bytes
/
docker-compose.yml
File metadata and controls
35 lines (32 loc) · 917 Bytes
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
services:
postgres:
image: postgres:16-alpine
environment:
POSTGRES_DB: taskservice
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres -d taskservice"]
interval: 5s
timeout: 5s
retries: 10
volumes:
- postgres_data:/var/lib/postgresql/data
- ./migrations/0001_create_tasks.up.sql:/docker-entrypoint-initdb.d/001_create_tasks.sql:ro
- ./migrations/0002_add_recurrence.up.sql:/docker-entrypoint-initdb.d/002_add_recurrence.sql:ro
app:
build:
context: .
dockerfile: Dockerfile
environment:
HTTP_ADDR: :8080
DATABASE_DSN: postgres://postgres:postgres@postgres:5432/taskservice?sslmode=disable
ports:
- "8080:8080"
depends_on:
postgres:
condition: service_healthy
volumes:
postgres_data: