-
Notifications
You must be signed in to change notification settings - Fork 2
/
docker-compose.yml
61 lines (56 loc) · 1.58 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
services:
db:
# Always specify your version
# used alpine version because we do not need the whole debian os that comes with postgres default image
# alpine is more than enough in our case
image: postgres:16.2-alpine
environment:
POSTGRES_DB: ClassroomDb
POSTGRES_USER: admin
POSTGRES_PASSWORD: admin
ports:
- "5432:5432"
volumes:
- db-data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U admin -d ClassroomDb"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
pgadmin:
# Always specify your version
# 8.5 is the latest right now so stick with this so the code works in years to come
image: dpage/pgadmin4:8.5
restart: always
container_name: pgadmin4
environment:
- PGADMIN_DEFAULT_EMAIL=admin@admin.com
- PGADMIN_DEFAULT_PASSWORD=pgadmin4
ports:
- '5050:80'
# db must be running and healthy before starting the pgadmin service
depends_on:
- db
healthcheck:
test: ["CMD-SHELL", "curl -f http://localhost:80/login || exit 1"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
# backend:
# build: .
# ports:
# - "3000:3000"
# # db must be running and healthy before starting the backend service
# depends_on:
# - db
# restart: on-failure
# healthcheck:
# test: ["CMD-SHELL", "curl -f http://localhost:3000/health || exit 1"]
# interval: 10s
# timeout: 5s
# retries: 5
# start_period: 10s
volumes:
db-data: