-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yaml
112 lines (104 loc) · 3.25 KB
/
docker-compose.yaml
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
# Remote Weather Access - Client/server solution for distributed weather networks
# Copyright (C) 2013-2023 Ralf Rettig ([email protected])
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# This configuration is primarily for easy testing and documents how this app can be deployed.
# Start it with: `docker-compose up`
version: '3'
services:
reverse-proxy:
image: nginx:1.27.4
ports:
- "80:80"
volumes:
- ./deployment/demo_deployment/nginx:/etc/nginx/conf.d
command: "/bin/sh -c 'while :; do sleep 6h & wait $${!}; nginx -s reload; done & nginx -g \"daemon off;\"'"
depends_on:
- frontend
frontend:
build:
context: .
dockerfile: Dockerfile.frontend
expose:
- 8050
environment:
- ENV_PATH=/app/frontend/environments/.frontend.docker-compose.env
- DOCKER_COMPOSE_APP=true
- PORT=8050
- BRAND_NAME
depends_on:
- backend
- database
- migrations
migrations:
build:
context: .
dockerfile: Dockerfile.frontend
entrypoint: /app/frontend/environments/perform_migrations.sh
environment:
- ENV_PATH=/app/frontend/environments/.frontend.docker-compose.env
depends_on:
- database
- object-storage
object-storage:
image: minio/minio:RELEASE.2023-06-02T23-17-26Z
ports:
- "9000:9000"
- "9001:9001"
volumes:
- ./storage/minio:/data
environment:
MINIO_ROOT_USER: minio_access_key
MINIO_ROOT_PASSWORD: minio_secret_key
command: server /data --console-address ":9001"
create-buckets:
image: minio/mc:RELEASE.2023-05-30T22-41-38Z
depends_on:
- object-storage
entrypoint: >
/bin/sh -c "
/usr/bin/mc alias set myminio http://object-storage:9000 minio_access_key minio_secret_key;
/usr/bin/mc mb myminio/django-frontend-static-files;
/usr/bin/mc anonymous set public myminio/django-frontend-static-files;
exit 0;
"
backend:
build:
context: .
dockerfile: Dockerfile.backend
ports:
- "8000:8000"
environment:
- DOCKER_COMPOSE_APP=true
- PORT=8000
- JWT_SECRET_KEY=SECRET-KEY
- DB_URL=database
- DB_PORT=5432
- DB_USER_DB_USER=userdb
- DB_USER_DB_PASSWORD=passwd1
- DB_WEATHER_DB_USER=weatherdatadb
- DB_WEATHER_DB_PASSWORD=passwd2
- DB_USER_DATABASE=users
- DB_WEATHER_DATABASE=weatherdata
- GUNICORN_WORKERS=2
- GUNICORN_ACCESSLOG=-
depends_on:
- database
database:
build:
context: deployment/demo_deployment/postgres
ports:
- "5432:5432"
environment:
- POSTGRES_PASSWORD=passwd