-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml
89 lines (85 loc) · 3.29 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
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
87
88
89
version: '2.4'
services:
app:
image: ccfp-asset-dashboard
container_name: ccfp-asset-dashboard
build: .
# Allow container to be attached to, e.g., to access the pdb shell
stdin_open: true
tty: true
ports:
# Map ports on your computer to ports on your container. This allows you,
# e.g., to visit your containerized application in a browser on your
# computer.
- 8000:8000
depends_on:
postgres:
condition: service_healthy
fp-postgis:
condition: service_healthy
volumes:
# Mount the development directory as a volume into the container, so
# Docker automatically recognizes your changes.
- .:/app
# Mount the node_modules directory so that our local mount doesn't
# clobber it.
- ccfp-asset-dashboard-node-modules:/app/node_modules
environment:
DJANGO_SECRET_KEY: reallysupersecret
DJANGO_MANAGEPY_MIGRATE: "on"
DJANGO_DEBUG: "True"
entrypoint: /app/docker-entrypoint.sh
command: python manage.py runserver 0.0.0.0:8000
postgres:
container_name: ccfp-asset-dashboard-postgres
image: postgis/postgis:15-3.3
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 5s
retries: 5
environment:
# The default Postgres image exposes a number of environmental variables
# that allow you to configure the container's behavior, without writing
# any additional code. Specify the name of your database, and any other
# variables, here. https://hub.docker.com/_/postgres/#environment-variables
POSTGRES_DB: database
POSTGRES_PASSWORD: postgres
volumes:
# By default, Postgres instantiates an anonymous volume. Use a named
# one, so your data persists beyond the life of the container. See this
# post for a discussion of the pitfalls of Postgres and anonymous
# volumes: https://linuxhint.com/run_postgresql_docker_compose/
- ccfp-asset-dashboard-db-data:/var/lib/postgresql/data
ports:
- 32001:5432
fp-postgis:
container_name: fp-postgis-instance
image: postgis/postgis:15-3.3
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 5s
retries: 5
environment:
# The default Postgres image exposes a number of environmental variables
# that allow you to configure the container's behavior, without writing
# any additional code. Specify the name of your database, and any other
# variables, here. https://hub.docker.com/_/postgres/#environment-variables
POSTGRES_DB: fpdcc
POSTGRES_PASSWORD: postgres
volumes:
# By default, Postgres instantiates an anonymous volume. Use a named
# one, so your data persists beyond the life of the container. See this
# post for a discussion of the pitfalls of Postgres and anonymous
# volumes: https://linuxhint.com/run_postgresql_docker_compose/
- fp-postgis-instance-data:/var/lib/postgresql/data
ports:
- 32002:5432
volumes:
# Declare your named volume for Postgres.
ccfp-asset-dashboard-db-data:
# Making node_modules a named volume prevents the ./app volume mount from
# clobbering the directory in the container.
ccfp-asset-dashboard-node-modules:
fp-postgis-instance-data: