-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
63 lines (44 loc) · 1.24 KB
/
Copy pathdocker-compose.yml
File metadata and controls
63 lines (44 loc) · 1.24 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
version: '3.1'
services:
# name of service. Both services will be attached to the default bridge network created at compose
# time. DNS's on the same network have automatic resolution to their IP.
# ch stands for Companies House.
ch_pg:
image: postgres
restart: always
environment:
POSTGRES_PASSWORD: ch_pass
POSTGRES_USER: ch_user
POSTGRES_DB: ch_db
ports:
- 5432:5432
volumes:
- postgres_data:/var/lib/postgresql/data
ch_app:
# at build time the deamon looks for Dockerfile in specified context.
build:
context: . # context = folder where the docker-compose.yml is.
# Default entrypoint: python3 /scr_code/app.py /scr_code/file.txt
entrypoint:
- python3
- /code/app.py
- /code/file.txt
depends_on:
- ch_pg # will be built before ch_app
volumes:
- ch_app_data:/code
# [ volumes definition ]
# creates Docker volumes which can be mounted by other containers too e.g. for backup
volumes:
postgres_data:
driver: local
driver_opts:
type: none
o: bind
device: ${PWD}/postgres_data
ch_app_data:
driver: local
driver_opts:
type: none
o: bind
device: ${PWD}/code