version: '3'

services:
  postgres:
    image: postgres:9.5
  web:
    build: .
    command:
      - /bin/sh
      - -c
      - |
        python manage.py collectstatic --ignore node_modules --noinput --clear
        python manage.py compress --force
        python manage.py migrate --noinput
        python manage.py loaddata core/fixtures/testdata-groups.json
        python manage.py loaddata core/fixtures/testdata-user.json
        python manage.py loaddata core/fixtures/testdata-core.json
        gunicorn --bind 0.0.0.0:8000 grady.wsgi:application
    ports:
      - "8000:8000"
    volumes:
      - /var/www/static:/code/static
    depends_on:
      - postgres
