Named volumes can't mount to a file path — use a directory. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
32 lines
691 B
YAML
32 lines
691 B
YAML
services:
|
|
web:
|
|
build: .
|
|
env_file: .env
|
|
volumes:
|
|
- db:/app/data
|
|
- media:/app/media
|
|
- static:/app/staticfiles
|
|
expose:
|
|
- "8000"
|
|
command: >
|
|
sh -c "python manage.py migrate --noinput &&
|
|
python manage.py collectstatic --noinput &&
|
|
gunicorn plantdb.wsgi:application --bind 0.0.0.0:8000 --workers 2"
|
|
restart: unless-stopped
|
|
|
|
nginx:
|
|
image: nginx:alpine
|
|
ports:
|
|
- "8083:80"
|
|
volumes:
|
|
- ./nginx/default.conf:/etc/nginx/conf.d/default.conf:ro
|
|
- media:/app/media:ro
|
|
- static:/app/staticfiles:ro
|
|
depends_on:
|
|
- web
|
|
restart: unless-stopped
|
|
|
|
volumes:
|
|
db:
|
|
media:
|
|
static:
|