-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
50 lines (47 loc) · 1.03 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
services:
app:
build:
context: .
dockerfile: ci/app/Dockerfile
container_name: app
restart: on-failure
healthcheck:
test: ["CMD", "python", "-c", "import sys; sys.exit(0)"]
interval: 1s
timeout: 5s
retries: 10
depends_on:
- database
ports:
- "8080:80"
networks:
- network
database:
build:
context: .
dockerfile: ci/database/Dockerfile
args:
USERNAME: ${CONTAINERISED_DB_USER}
PASSWORD: ${CONTAINERISED_DB_PASSWORD}
DB_NAME: ${CONTAINERISED_DB_NAME}
container_name: db
restart: unless-stopped
# environment:
# POSTGRES_HOST_AUTH_METHOD: reject
# TODO have the db name dynamic here as well
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U root -d database" ]
interval: 1s
timeout: 5s
retries: 10
volumes:
- database:/var/lib/postgresql/data
ports:
- "5432:5432"
networks:
- network
networks:
network:
driver: bridge
volumes:
database: