-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcompose.yml
81 lines (78 loc) · 2.42 KB
/
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
services:
# React client application
client:
# Build from Dockerfile in the client directory
build:
context: ./client
ports:
- "5173:5173"
volumes:
- /app/client/node_modules # Allow container to manage its own dependencies
- .:/app
working_dir: /app/client
environment:
- NODE_ENV=development
# Enable HMR websocket connections
command: npm run dev -- --host
# GeoDjango web application
server:
# Build from the Dockerfile in the server directory
build:
context: ./server
# Host to container port mapping
ports:
- "8000:8000"
environment:
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PW=${POSTGRES_PW}
- POSTGRES_DB=${POSTGRES_DB}
- DJANGO_SUPERUSER_USERNAME=${DJANGO_SUPERUSER_USERNAME}
- DJANGO_SUPERUSER_EMAIL=${DJANGO_SUPERUSER_EMAIL}
- DJANGO_SUPERUSER_PASSWORD=${DJANGO_SUPERUSER_PASSWORD}
# Volume mount
volumes:
- .:/app
working_dir: /app/server
entrypoint: ["/entrypoint.sh"]
command: python manage.py runserver 0.0.0.0:8000
# Keep container active and interactive
tty: true
stdin_open: true
depends_on:
db:
condition: service_healthy
# PostgreSQL database with PostGIS
db:
# Build based on latest offical image
# (https://registry.hub.docker.com/r/postgis/postgis/)
image: postgis/postgis
container_name: postgis
ports:
- "5432:5432"
# More info on PostgreSQL container environment variables
# (https://github.com/docker-library/docs/blob/master/postgres/README.md)
environment:
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PW}
- POSTGRES_DB=${POSTGRES_DB}
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
interval: 5s
timeout: 5s
retries: 5
# Database management tool
pgadmin:
container_name: pgadmin
image: dpage/pgadmin4:latest
# More info on pgAdmin container environment variables
# (https://www.pgadmin.org/docs/pgadmin4/latest/container_deployment.html)
environment:
- PGADMIN_DEFAULT_EMAIL=${PGADMIN_MAIL}
- PGADMIN_DEFAULT_PASSWORD=${PGADMIN_PW}
# Add server configuration as JSON
- PGADMIN_SERVER_JSON_FILE=/pgadmin4/servers.json
ports:
- "5050:80"
volumes:
# Mount the server configuration file
- ./pgadmin-servers.json:/pgadmin4/servers.json