version: "3.6"

volumes:
  static-files:
  node-modules:

services:
  celery:
    environment:
      - DJANGO_SETTINGS_MODULE=newsreader.conf.docker
    volumes:
      - ./src/:/app/src

  django:
    build:
      target: development
    command: python /app/src/manage.py runserver 0.0.0.0:${DJANGO_PORT:-8000}
    environment:
      - DJANGO_SETTINGS_MODULE=newsreader.conf.docker
    ports:
      - "${DJANGO_PORT:-8000}:${DJANGO_PORT:-8000}"
    volumes:
      - ./src:/app/src
      - static-files:/app/src/newsreader/static
    stdin_open: true
    tty: true

  webpack:
    build:
      context: .
      dockerfile: ./docker/webpack
    command: npm run build:watch
    volumes:
      - ./src/:/app/src
      - static-files:/app/src/newsreader/static
      - node-modules:/app/node_modules
