-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
86 lines (76 loc) · 1.89 KB
/
docker-compose.yaml
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
services:
db:
image: postgres:latest
container_name: db
ports:
- ${DATABASE_PORT:-5432}:5432
volumes:
- ./data/service-core-db:/var/lib/postgresql/data
networks:
- service-core-backend
healthcheck:
test: "exit 0"
environment:
POSTGRES_DB: ${DATABASE_NAME}
POSTGRES_USER: ${DATABASE_USER}
POSTGRES_PASSWORD: ${DATABASE_PASSWORD}
service-migrate:
restart: on-failure
build:
context: .
dockerfile: Dockerfile.migrate
container_name: migrate
volumes:
- .:/app
depends_on:
db:
condition: service_started
networks:
- service-core-backend
environment:
DATABASE_PORT: ${DATABASE_PORT}
DATABASE_USER: ${DATABASE_USER}
DATABASE_PASSWORD: ${DATABASE_PASSWORD}
DATABASE_NAME: ${DATABASE_NAME}
DATABASE_HOST: ${DATABASE_HOST}
command: >
migrate -m ./internal/store/pgstore/migrations --config ./internal/store/pgstore/migrations/tern.conf
app:
build: .
ports:
- 3000:3000
container_name: app
volumes:
- .:/app
depends_on:
- service-migrate
networks:
- service-core-backend
environment:
DATABASE_PORT: ${DATABASE_PORT}
DATABASE_USER: ${DATABASE_USER}
DATABASE_PASSWORD: ${DATABASE_PASSWORD}
DATABASE_NAME: ${DATABASE_NAME}
DATABASE_HOST: ${DATABASE_HOST}
pgadmin:
image: dpage/pgadmin4:latest
restart: unless-stopped
container_name: pgadmin
depends_on:
- db
- service-migrate
ports:
- 8081:80
networks:
- service-core-backend
environment:
PGADMIN_DEFAULT_EMAIL: ${PGADMIN_DEFAULT_EMAIL:[email protected]}
PGADMIN_DEFAULT_PASSWORD: ${PGADMIN_DEFAULT_PASSWORD:-password}
volumes:
- pgadmin:/var/lib/pgadmin
networks:
service-core-backend:
driver: "bridge"
volumes:
pgadmin:
driver: local