-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yml
43 lines (43 loc) · 1.04 KB
/
docker-compose.yml
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
version: '3.9'
services:
db:
container_name: skeleton-db
image: postgres:14-alpine
command: ["postgres", "-c", "log_statement=all", "-c", "log_destination=stderr"]
restart: always
environment:
- POSTGRES_DB=skeleton
- POSTGRES_USER=docker
- POSTGRES_PASSWORD=docker
ports:
- "5432:5432"
volumes:
- skeleton-data:/var/lib/postgresql/data
healthcheck:
test: "pg_isready -U postgres -d artwork"
interval: 10s
timeout: 5s
retries: 5
migrate:
container_name: skeleton-migrate
image: migrate/migrate
volumes:
- ./deploy/migrations:/migrations
command: ["-path", "/migrations", "-database", "postgres://docker:docker@db:5432/skeleton?sslmode=disable", "up"]
depends_on:
db:
condition: service_healthy
app:
container_name: skeleton-app
env_file:
- .env
build:
context: .
dockerfile: Dockerfile
ports:
- "8000:8000"
depends_on:
db:
condition: service_healthy
volumes:
skeleton-data: