version: "2.1" services: # Compiles the assets and provides them as volumes for app and nginx. assets: build: . command: assets volumes: - assets:/opt/app/assets app: build: . volumes: # Map the uwsgi config from the host config - ./docker/uwsgi.ini:/etc/uwsgi/uwsgi.ini:ro # We put our local media here - ./data/media:/opt/app/data/media # Output the logs on a folder in the host machine - ./data/log:/opt/app/data/log # We require the compiled assets to know what urls to generate. - assets:/opt/app/assets command: app worker: build: . volumes: - ./data/log:/opt/app/data/log command: worker nginx: image: nginx:1.13-alpine volumes: # Map the nginx config from the host config - ./docker/nginx.conf:/etc/nginx/nginx.conf:ro # We need to deliver this media - ./data/media:/opt/app/data/media:ro # We always give the static assets from nginx - assets:/opt/appassets depends_on: - app - assets varnish: build: ./docker/varnish ports: - "${UCHAN_PORT}:80" environment: - UCHAN_VARNISH_MEMSIZE depends_on: - nginx - app - worker db: image: postgres:9.6-alpine environment: - POSTGRES_USER=uchan - POSTGRES_PASSWORD=uchan volumes: # We store the database in the data directory of the host - ./data/database:/var/lib/postgresql/data memcached: image: memcached:1.4-alpine queue: image: rabbitmq:alpine volumes: assets: