version: '3'

services:
  db:
    image: postgres:12
    volumes:
      - dbdata:/var/lib/postgresql/data
    ports:
      - "5432:5432"
    environment:
      - POSTGRES_PASSWORD=postgres

  web:
    build: .
    image: registry.gitlab.com/sahkoinsinoorikilta/vtmk/web2.0-backend
    command: ["bash", "-c", "cd /app & bash setup.sh --no-input --no-npm && gunicorn -w 4 -b 0.0.0.0:8000 sikweb.wsgi"]
    env_file:
      - .env
    ports:
      - "8000:8000"
    depends_on:
      - db

volumes:
  dbdata:
