ojuso-map/docker-compose.yml
2018-04-23 01:57:28 -04:00

92 lines
2.2 KiB
YAML

version: "3.3"
services:
map:
restart: always
build: .
links:
- db:db
- cache:cache
networks:
- web
labels:
- "traefik.backend=app"
- "traefik.frontend.rule=Host:map.ojuso.org"
- "traefik.frontend.priority=5"
- "traefik.frontend.passHostHeader=true"
volumes:
- ./apps:/app/apps
- ./ojusomap:/app/ojusomap
- ./support:/app/support
- /containers/map/static:/app/static
- /containers/map/gunicorn.sock:/app/gunicorn.sock
env_file:
- ./environment
command: /bin/sh -c "DEBUG=1 python3 manage.py collectstatic --noinput && python3 manage.py compilemessages && python3 manage.py migrate && gunicorn --bind 0.0.0.0:8000 ojusomap.wsgi"
db:
restart: always
image: mdillon/postgis:9.6-alpine
networks:
- web
volumes:
- /containers/db:/var/lib/postgresql/data
- ./support/postgres/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d
ports:
- "127.0.0.1:5432:5432"
env_file:
- ./environment
weblate:
image: weblate/weblate
links:
- db:database
- cache
networks:
- web
labels:
- "traefik.backend=weblate"
- "traefik.frontend.rule=Host:translate.ojuso.org"
- "traefik.frontend.priority=5"
- "traefik.frontend.passHostHeader=true"
volumes:
- weblate-data:/app/data
env_file:
- ./environment
environment:
- "POSTGRES_USER=weblate"
- "POSTGRES_DATABASE=weblate"
- "MEMCACHED_HOST=cache"
restart: always
cache:
image: memcached:1.4
restart: always
networks:
- web
weblate_static:
image: nginx:alpine
restart: always
depends_on:
- weblate
labels:
- "traefik.backend=weblate_static"
- "traefik.frontend.rule=Host:translate.ojuso.org;PathPrefixStrip:/static/"
- "traefik.frontend.priority=10"
networks:
- web
volumes:
- type: bind
source: /var/lib/docker/volumes/ojusomap_weblate-data/_data/static
target: /usr/share/nginx/html
read_only: true
networks:
web:
external:
name: traefik_webgateway
volumes:
weblate-data:
weblate-static: