-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
49 lines (44 loc) · 1.06 KB
/
docker-compose.yml
File metadata and controls
49 lines (44 loc) · 1.06 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
name: avito_tech_internship
version: "3.9"
services:
postgres:
image: postgres:latest
container_name: ${COMPOSE_PROJECT_NAME}_postgres
restart: always
env_file:
- .env
ports:
- "127.0.0.1:${POSTGRES_PORT}:5432"
healthcheck:
test: ["CMD", "pg_isready", "-U", "${POSTGRES_USER}"]
interval: 2s
timeout: 3s
retries: 10
volumes:
- postgres_data:/var/lib/postgresql
migrate:
image: migrate/migrate
container_name: ${COMPOSE_PROJECT_NAME}_migrate
restart: no
depends_on:
postgres:
condition: service_healthy
command: [
"-path", "/migrations",
"-database", "postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB}?sslmode=disable",
"up"
]
volumes:
- ./migrations:/migrations:ro
backend:
build: .
container_name: ${COMPOSE_PROJECT_NAME}_backend
depends_on:
migrate:
condition: service_completed_successfully
env_file:
- .env
ports:
- "${APP_PORT}:8080"
volumes:
postgres_data: