|
1 |
| -version: "3.8" |
2 | 1 | services:
|
3 |
| - web: |
4 |
| - platform: linux/amd64 |
5 |
| - image: developmentseed/osmseed-osmcha-web:v16 |
| 2 | + django: |
| 3 | + image: "ghcr.io/openhistoricalmap/osmcha-django:upstream_main" |
| 4 | + depends_on: |
| 5 | + - redis |
| 6 | + volumes: |
| 7 | + # Copy static files into a shared volume so the frontend can serve them |
| 8 | + - staticfiles:/app/staticfiles |
| 9 | + env_file: ./../envs/.env.osmcha |
| 10 | + ports: |
| 11 | + - "5001:5000" |
| 12 | + entrypoint: ["/bin/sh", "-c"] |
| 13 | + command: |
| 14 | + - | |
| 15 | + python manage.py migrate --verbosity 3 && \ |
| 16 | + python manage.py collectstatic --noinput && \ |
| 17 | + gunicorn config.wsgi -t 120 -b 0.0.0.0:5000 --access-logfile - --log-level debug |
| 18 | + frontend: |
6 | 19 | build:
|
7 | 20 | context: ../images/osmcha-web
|
8 | 21 | dockerfile: Dockerfile
|
9 |
| - env_file: |
10 |
| - - ../envs/.env.osmcha |
| 22 | + depends_on: |
| 23 | + - django |
11 | 24 | volumes:
|
12 |
| - - ../data/osmcha/staticfiles:/staticfiles |
13 |
| - db: |
14 |
| - platform: linux/amd64 |
15 |
| - image: osmseed-osmcha-db:v1 |
16 |
| - build: |
17 |
| - context: ../images/osmcha-db |
18 |
| - dockerfile: Dockerfile |
| 25 | + # frontend serves django app's static files via shared volume |
| 26 | + - staticfiles:/srv/www/static/django |
| 27 | + env_file: ./../envs/.env.osmcha |
| 28 | + |
19 | 29 | ports:
|
20 |
| - - "5432:5432" |
21 |
| - volumes: |
22 |
| - - ../data/osmcha-db-data:/var/lib/postgresql/data |
23 |
| - env_file: |
24 |
| - - ../envs/.env.osmcha |
25 |
| - init: |
26 |
| - platform: linux/amd64 |
27 |
| - image: ghcr.io/willemarcel/osmcha-django:b1f4e6afc90e08707cadc4d74580632ca3b93dd2 |
28 |
| - command: > |
29 |
| - /bin/bash -c " |
30 |
| - set -x |
31 |
| - python manage.py collectstatic |
32 |
| - python manage.py migrate |
33 |
| - mkdir -p /staticfiles/static |
34 |
| - cp -r /app/staticfiles/* /staticfiles/static/ |
35 |
| - " |
36 |
| - env_file: |
37 |
| - - ../envs/.env.osmcha |
38 |
| - volumes: |
39 |
| - - ../data/osmcha/staticfiles:/staticfiles |
40 |
| - api: |
41 |
| - platform: linux/amd64 |
42 |
| - image: ghcr.io/willemarcel/osmcha-django:b1f4e6afc90e08707cadc4d74580632ca3b93dd2 |
43 |
| - build: |
44 |
| - context: ../images/osmcha-api |
45 |
| - dockerfile: Dockerfile |
46 |
| - command: > |
47 |
| - /bin/bash -c " |
48 |
| - set -x |
49 |
| - python manage.py collectstatic |
50 |
| - python manage.py migrate |
51 |
| - mkdir -p /staticfiles/static |
52 |
| - cp -r /app/staticfiles/* /staticfiles/static/ |
53 |
| - gunicorn --workers 4 --bind 0.0.0.0:5000 --log-file - --access-logfile - config.wsgi |
54 |
| - " |
| 30 | + - "8000:80" |
| 31 | + |
| 32 | + redis: |
| 33 | + image: redis:latest |
| 34 | + container_name: redis |
| 35 | + restart: always |
55 | 36 | ports:
|
56 |
| - - "5000:5000" |
57 |
| - env_file: |
58 |
| - - ../envs/.env.osmcha |
59 |
| - volumes: |
60 |
| - - ../data/osmcha/staticfiles:/staticfiles |
| 37 | + - "6379:6379" |
| 38 | +volumes: |
| 39 | + staticfiles: |
0 commit comments