version: '3'
services:
  web:
    container_name: web
    build: ./docker/web
    pull_policy: build
    working_dir: /etc/nginx
    ports:
      - 80:80
    volumes:
      - django-static:/var/www/html/static
    links:
      - app
    restart: unless-stopped

  app:
    container_name: app
    build: .
    pull_policy: build
    working_dir: /django_project
    environment:
      DJANGO_SECRET_KEY: $DJANGO_SECRET_KEY
      ALLOWED_HOSTS: $ALLOWED_HOSTS
      DEBUG: $DEBUG
    volumes:
      - django-static:/var/www/html/static
      - ./data:/django_project/data:rw
    restart: unless-stopped

volumes:
  django-static:
