lab-2: add web_lite and web_pg configurations

This commit is contained in:
DeevEV 2026-05-05 12:20:00 +03:00
parent 568aedf3e6
commit 65dbbc9a8b
3 changed files with 72 additions and 0 deletions

1
lab-2/http.restbook Normal file

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,27 @@
name: lab2-web-lite
services:
backend_service:
image: dcr.deev.su/deevev/lab2-backend:1.0.0
command: >
sh -c "python manage.py migrate &&
python manage.py collectstatic --no-input &&
gunicorn lab1.wsgi:application --bind 0.0.0.0:8000"
volumes:
- static_volume:/app/staticfiles
env_file:
- .env
restart: unless-stopped
nginx_service:
image: dcr.deev.su/deevev/lab2-nginx:1.0.0
ports:
- "80:80"
volumes:
- static_volume:/staticfiles
depends_on:
- backend_service
restart: unless-stopped
volumes:
static_volume:

View file

@ -0,0 +1,44 @@
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/deevev/lab2-backend:1.0.0
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/deevev/lab2-nginx:1.0.0
ports:
- "80:80"
volumes:
- static_volume:/staticfiles
depends_on:
- backend_service
restart: unless-stopped
volumes:
static_volume:
postgres_data: