-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yaml
74 lines (71 loc) · 1.81 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
version: "3.4"
services:
imdb-analyser:
image: ghcr.io/mushroomator/imdb-analyser
container_name: imdb-analyser
restart: always
ports:
- 5000:5000
networks:
- web-net
healthcheck:
test: ["CMD", "wget", "-q", "--spider", "localhost:5000/api/v1/healthcheck"]
interval: 10s
timeout: 20s
retries: 3
start_period: 5s
environment:
DB_USERNAME: admin
DB_HOST: postgres-db
DB_PASSWORD: simplepw
DB_DATABASE: imdb
DB_PORT: 5432
db:
image: postgres:14.0-alpine
container_name: postgres-db
restart: always
ports:
- 5432:5432
networks:
- web-net
healthcheck:
test: ["CMD", "pg_isready", "-h", "localhost", "-p", "5432", "-U", "admin", "-d", "imdb"]
interval: 10s
timeout: 20s
retries: 3
start_period: 5s
volumes:
# mount postgres config
- "./PostgreSQL/postgresql.conf:/etc/postgresql/postgresql.conf"
# mount initialization script
- "./PostgreSQL/sql-scripts:/docker-entrypoint-initdb.d"
# create/ mount data volume to persist data even when containers are not running
- db-data:/var/lib/postgresql/data
environment:
POSTGRES_PASSWORD: simplepw
POSTGRES_USER: admin
POSTGRES_DB: imdb
pgadmin:
image: dpage/pgadmin4:6.2
container_name: pgadmin
restart: always
ports:
- 80:80
networks:
- web-net
volumes:
# load server configuration
- "./pgAdmin/servers.json:/pgadmin4/servers.json"
healthcheck:
test: ["CMD", "wget", "-q", "--spider" ,"localhost:80"]
interval: 10s
timeout: 20s
retries: 3
start_period: 20s
environment:
PGADMIN_DEFAULT_EMAIL: [email protected]
PGADMIN_DEFAULT_PASSWORD: simplepw
networks:
web-net:
volumes:
db-data: