name: lab2-web-pg services: postgres_service: image: postgres:alpine env_file: - .env healthcheck: test: ["CMD-SHELL", "pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB"] interval: 10s timeout: 30s retries: 5 volumes: - postgres_data:/var/lib/postgresql/data backend_service: image: dcr.deev.su/edeev/lab2-aad/backend:latest command: > # python manage.py createsuperuser --noinput && sh -c "python manage.py migrate && python manage.py shell -c 'from quiz.gentestdata import gentestdata; gentestdata()' && python manage.py collectstatic --no-input && gunicorn lab1.wsgi:application --bind 0.0.0.0:8000" volumes: - static_volume:/app/staticfiles env_file: - .env depends_on: postgres_service: condition: service_healthy restart: unless-stopped nginx_service: image: dcr.deev.su/edeev/lab2-aad/nginx:latest ports: - "80:80" volumes: - static_volume:/staticfiles depends_on: - backend_service restart: unless-stopped volumes: static_volume: postgres_data: