forked from climsoft/climsoft-web
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.prod.yaml
More file actions
112 lines (105 loc) · 3.66 KB
/
docker-compose.prod.yaml
File metadata and controls
112 lines (105 loc) · 3.66 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
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
services:
climsoft_nginx_proxy:
image: climsoftdevelopers/climsoft-nginx-proxy:preview-3.0.0
container_name: climsoft-nginx-proxy
restart: always
ports: # Expose to external network
- "${HOST_HTTP_PORT}:80"
depends_on:
- climsoft_pwa
- climsoft_api
networks:
- climsoft_network
climsoft_pwa:
image: climsoftdevelopers/climsoft-pwa:preview-3.0.0
container_name: climsoft-pwa
restart: always
environment:
HOST_IP_ADDRESS: "${HOST_IP_ADDRESS}" # used in config.json.
HOST_HTTP_PORT: "${HOST_HTTP_PORT}" # used in config.json.
expose:
- 80 # Expose to internal network only.
depends_on:
- climsoft_api
networks:
- climsoft_network
climsoft_api:
image: climsoftdevelopers/climsoft-api:preview-3.0.0
container_name: climsoft-api
restart: always
environment:
DB_HOST: climsoft_db
DB_PORT: 5432
DB_NAME: "${DB_NAME}"
DB_USERNAME: postgres
DB_PASSWORD: "${DB_PASSWORD}"
FIRST_INSTALL: "${FIRST_INSTALL}"
V4_SAVE: "${V4_SAVE}"
V4_IMPORT: "${V4_IMPORT}"
V4_DB_HOST: "${V4_DB_HOST}"
V4_DB_PORT: "${V4_DB_PORT}"
V4_DB_NAME: "${V4_DB_NAME}"
V4_DB_USERNAME: "${V4_DB_USERNAME}"
V4_DB_PASSWORD: "${V4_DB_PASSWORD}"
V4_DB_UTCOFFSET: "${V4_DB_UTCOFFSET}"
CSV2BUFR_HOST: climsoft_csv2bufr
CSV2BUFR_PORT: 5001
expose:
- 3000 # Expose to internal network only. Communication to the API can go through the nginx reverse proxy.
depends_on:
climsoft_db:
condition: service_healthy # Wait until climsoft_db is healthy as indicate by healthcheck
climsoft_csv2bufr:
condition: service_healthy
volumes:
- climsoft_imports:/app/imports
- climsoft_exports:/app/exports
networks:
- climsoft_network
climsoft_csv2bufr:
image: climsoftdevelopers/climsoft-csv2bufr:preview-3.0.0
container_name: climsoft-csv2bufr
restart: always
expose:
- 5001 # Expose to internal network only.
volumes:
- climsoft_exports:/app/exports
networks:
- climsoft_network
healthcheck:
test: ["CMD", "python3", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:5001/health')"]
interval: 10s
timeout: 5s
retries: 5
climsoft_db:
image: postgis/postgis:17-3.5
container_name: climsoft-db
restart: always
environment:
POSTGRES_DB: "${DB_NAME}" # Default database postgres will create, required when setting up postgres the first time.
POSTGRES_USER: postgres # Uses the default postgres username for simplicity, required when setting up postgres the first time.
POSTGRES_PASSWORD: "${DB_PASSWORD}" # Super user password, required when setting up postgres the first time.
ports:
- "5432:5432" # Expose to both external and internal network.
volumes:
- climsoft_database:/var/lib/postgresql/data
- climsoft_imports:/var/lib/postgresql/imports
- climsoft_exports:/var/lib/postgresql/exports
networks:
- climsoft_network
# Recursively change the ownership of the /var/lib/postgresql/exports directory and all its contents to user postgres and group postgres.
# The executes the default PostGIS/PostgreSQL startup entrypoint, passing postgres as the command to run the Postgres server.
command: >
sh -c "chown -R postgres:postgres /var/lib/postgresql/exports
&& docker-entrypoint.sh postgres"
healthcheck:
test: ["CMD", "pg_isready", "-U", "postgres"]
interval: 5s
timeout: 3s
retries: 10
volumes:
climsoft_database:
climsoft_imports:
climsoft_exports:
networks:
climsoft_network: