version: '3'
volumes:
  postgres_data:
    driver: local
services:
    ngsurvey:
        image: ngsurvey/ngsurveyee:latest
        restart: always
        ports:
           - 8080:80
        depends_on:
           - postgresngsurveydb
        command: ["./wait-for-it.sh", "postgresngsurveydb:5432", "--", "python", "app.py"]
        environment:
           - ConnectionStrings:NGSurveyDB=User ID=ngspostgres;password=maythe4rcebewithyou;Host=postgresngsurveydb;Port=5432;Database=ngsurveydb;Pooling=true;;
           - NGSurvey:StorageEngine=Postgres
    postgresngsurveydb:
        image: postgres:latest
        cap_add:
           - SYS_NICE
        restart: always
        volumes:
           - postgres_data:/var/lib/postgresql/data
        environment:
           - POSTGRES_USER=ngspostgres
           - POSTGRES_PASSWORD=maythe4rcebewithyou
