Files
my_shop/docker-compose.yml

43 lines
1.3 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

services:
db:
image: postgres:15
restart: always
environment:
- POSTGRES_DB=my_shop_db
- POSTGRES_USER=shop_user
- POSTGRES_PASSWORD=shop_password
volumes:
# Храним данные базы прямо в папке проекта на сервере
- ./postgres_data:/var/lib/postgresql/data
web:
build: .
# Включаем режим сервера для settings.py
environment:
- ENV_TYPE=server
- DB_NAME=my_shop_db
- DB_USER=shop_user
- DB_PASS=shop_password
- DB_HOST=db
volumes:
- .:/app
- ./staticfiles:/app/staticfiles
- ./media:/app/media
expose:
- "8000"
depends_on:
- db
# Раскомментируй строку ниже, если используешь gunicorn мы его запускаем в доекрфайле
# command: gunicorn core.wsgi:application --bind 0.0.0.0:8000 --workers 3
nginx:
image: nginx:latest
volumes:
# Прокидываем конфиг и статику напрямую из папок
- ./nginx/default.conf:/etc/nginx/conf.d/default.conf
- ./staticfiles:/app/staticfiles
- ./media:/app/media
ports:
- "8080:80"
depends_on:
- web