version: "3.3"
services:
db:
restart: always
image: postgres:14.6-alpine
ports:
- "15163:5432"
env_file:
- ./backend/.env
backend:
build:
context: ./backend
ports:
- "8000:8000"
command: >
sh -c "
cd ./workograd &&
python manage.py collectstatic --noinput &&
python manage.py migrate &&
gunicorn workograd.wsgi:application -b 0.0.0.0:8000 --max-requests 10000 --log-level info --access-logfile - --error-logfile -
"
env_file:
- ./backend/.env
volumes:
- static_volume:/app/workograd/static
- media_volume:/app/workograd/media
depends_on:
- db
frontend:
build: ./frontend
restart: always
ports:
- "3000:3000"
command: npm start
depends_on:
- backend
nginx:
build:
context: ./nginx
ports:
- "80:80"
volumes:
- static_volume:/app/workograd/static
- media_volume:/app/workograd/media
depends_on:
- backend
volumes:
static_volume:
media_volume:
статику фронтенд-приложения дополнительно подключил, все получилось!