  version: '3'
    
  services:
    # db:
    #   image: postgres:9.6.5
    #   environment:
    #     - POSTGRES_DB=postgres
    #     - POSTGRES_USER=postgres
    #     - POSTGRES_PASSWORD=postgres
    #   volumes:
    #     - postgres_data:/var/lib/postgresql/data
    #   ports:
    #     - "5432"
#     db:
#       image: mysql:latest
#       ports:
#         - '3306:3306'
#       environment:
#         MYSQL_DATABASE: 'scsdb'
#         MYSQL_USER: 'root'
#         MYSQL_PASSWORD: 'P@s$w0rd123!'
#         MYSQL_ROOT_PASSWORD: 'P@s$w0rd123!'
#       volumes:
#         - "./con-my.cnf:/etc/mysql/conf.d/config-file.cnf"
#         - "./data:/var/lib/mysql:rw"       
# #       - ./db:/docker-entrypoint-initdb.d/:ro

    web:
      build: .
      command: bash -c "./scripts/before-start.sh && python manage.py runserver 0.0.0.0:8000"
      #stdin_open: true
      #tty: true
      volumes:
        - .:/code
      ports:
        - "8000:8000"
      #extra_hosts:
       # - "host.docker.internal:host-gateway"    
      # environment:
      #   - POSTGRES_NAME=postgres
      #   - POSTGRES_USER=postgres
      #   - POSTGRES_PASSWORD=postgres
      # depends_on:
      #   - db

    nginx:
      image: nginx:1.18.0
      build: ./compose/nginx
      depends_on:
        - web
      ports:
        - "0.0.0.0:80:80"
      volumes:
        - ./media:/var/www/media
  # volumes:
  #   postgres_data:

#https://roytuts.com/docker-compose-dockerizing-django-mysql-app/