version: '3' services: db: image: postgres:10-alpine env_file: - .env ports: - "127.0.0.1:5432:5432" volumes: - ./postgres_data:/var/lib/postgresql/data/pgdata redis: image: redis:latest ports: - "127.0.0.1:6379:6379" volumes: - ./redis_data:/data web: build: . restart: always volumes: - .:/lilcity command: bash -c "python manage.py collectstatic --no-input && python manage.py migrate && python manage.py loaddata /lilcity/apps/*/fixtures/*.json && gunicorn --workers=4 project.wsgi --bind=0.0.0.0:8000 --worker-class=gthread --reload" env_file: - .env ports: - "127.0.0.1:${PORT}:8000" depends_on: - db - redis links: - db - redis workers: build: . restart: always volumes: - .:/lilcity command: bash -c "celery worker -A project -B" env_file: - .env depends_on: - db - redis - web links: - db - redis - web