-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
55 lines (52 loc) · 1.34 KB
/
docker-compose.yml
File metadata and controls
55 lines (52 loc) · 1.34 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
services:
db:
image: postgres:17-alpine
container_name: postgres_db
restart: unless-stopped
env_file:
- .env
environment:
- POSTGRES_USER=${POSTGRES_SUPER_USER}
- POSTGRES_PASSWORD=${POSTGRES_SUPER_PASSWORD}
- POSTGRES_DB=${POSTGRES_DB}
- POSTGRES_HOST=${POSTGRES_HOST}
- POSTGRES_PORT=${POSTGRES_PORT}
- APP_DATABASE_SCHEMA=${APP_DATABASE_SCHEMA}
ports:
- "${POSTGRES_PORT}:${POSTGRES_PORT}"
volumes:
- postgres_data:/var/lib/postgresql/data
# - ./init-schema.sh:/docker-entrypoint-initdb.d/init-schema.sh
healthcheck:
test:
- CMD-SHELL
- pg_isready -U ${POSTGRES_SUPER_USER} -d ${POSTGRES_DB}
interval: 10s
timeout: 5s
retries: 5
networks:
- app_network
atlas:
image: arigaio/atlas:latest
container_name: atlas_migrations
depends_on:
db:
condition: service_healthy
env_file:
- .env
volumes:
- ./migrations:/migrations
command: >
migrate apply
--url "postgres://${POSTGRES_SUPER_USER}:${POSTGRES_SUPER_PASSWORD}@db:5432/${POSTGRES_DB}?sslmode=disable"
--dir "file:///migrations"
networks:
- app_network
volumes:
postgres_data:
name: postgres_data
postgres_data_dev:
name: postgres_data_dev
networks:
app_network:
driver: bridge