version: "3.3"

services:
  nginx:
    container_name: seatstock-nginx
    image: nginx:latest
    restart: unless-stopped
    ports:
      - "80:80"
    volumes:
      - ../frontend:/usr/share/nginx/html
      - ./volumes/nginx/config/default.conf:/etc/nginx/conf.d/default.conf:ro

  docker-django:
    image: docker-django
    container_name: seatstock-django
    restart: unless-stopped
#    ports:
#      - "8000:8000"
    volumes:
      - ../backend/django:/home/app/webapp
      - ../frontend/templates:/home/app/webapp/seatstock_django/seatstock_django/templates
      - ../frontend/static:/home/app/webapp/seatstock_django/seatstock_django/static
      - ../frontend/templates:/home/app/webapp/seatstock_django/django_mongo/templates
      - ../frontend/static:/home/app/webapp/seatstock_django/django_mongo/static
    environment:
      - AUTH0_DOMAIN=${AUTH0_DOMAIN}
      - AUTH0_CLIENT_ID=${AUTH0_CLIENT_ID}
      - AUTH0_CLIENT_SECRET=${AUTH0_CLIENT_SECRET}
      - MONGO_DB_USERNAME=${MONGO_DB_USERNAME}
      - MONGO_DB_PASSWORD=${MONGO_DB_PASSWORD}
      - MONGO_DB_HOST=${MONGO_DB_HOST}
      - DB_NAME=${DB_NAME}
      - DB_USER=${DB_USER}
      - DB_PASSWORD=${DB_PASSWORD}
      - DB_HOST=${DB_HOST}
      - DB_PORT=${DB_PORT}

  postgres:
    image: postgres:latest
    container_name: seatstock-postgres
    restart: unless-stopped
    volumes:
      - ./volumes/postgresql:/var/lib/postgresql/data
    environment:
      - POSTGRES_PASSWORD=${DB_PASSWORD}
      - POSTGRES_USER=${DB_USER}
      - POSTGRES_DB=${DB_NAME}
