mirror of
https://github.com/thecyberlearn/modern-django-starter.git
synced 2026-08-18 07:52:54 +00:00
- Add build-time static file collection to handle Docker volume permission issues - Create django_project/settings/build.py for minimal build-time settings - Enhance entrypoint.sh with graceful fallback when collectstatic fails - Improve Dockerfile permissions and add Tailwind build during Docker build - Add WARP.md with comprehensive development guidance - Include test-docker-build.sh script for local testing - Update docker-compose.dokploy.yml with build optimizations Fixes permission denied errors during static file collection on Dokploy deployments.
53 lines
1.4 KiB
YAML
53 lines
1.4 KiB
YAML
services:
|
|
web:
|
|
build:
|
|
context: .
|
|
target: production
|
|
args:
|
|
- BUILDKIT_INLINE_CACHE=1
|
|
command: >
|
|
sh -c "chmod +x /app/entrypoint.sh &&
|
|
/app/entrypoint.sh &&
|
|
gunicorn --bind 0.0.0.0:8000 --workers 3 django_project.wsgi:application"
|
|
volumes:
|
|
- "../files/staticfiles:/app/staticfiles"
|
|
- "../files/media:/app/media"
|
|
expose:
|
|
- 8000
|
|
env_file:
|
|
- .env
|
|
depends_on:
|
|
- db
|
|
- redis
|
|
environment:
|
|
- DJANGO_SETTINGS_MODULE=django_project.settings.production
|
|
networks:
|
|
- dokploy-network
|
|
labels:
|
|
- "traefik.enable=true"
|
|
- "traefik.http.routers.django-app.rule=Host(`your-domain.com`)"
|
|
- "traefik.http.routers.django-app.entrypoints=websecure"
|
|
- "traefik.http.routers.django-app.tls.certResolver=letsencrypt"
|
|
- "traefik.http.services.django-app.loadbalancer.server.port=8000"
|
|
|
|
db:
|
|
image: postgres:15-alpine
|
|
volumes:
|
|
- "../files/postgres_data:/var/lib/postgresql/data/"
|
|
environment:
|
|
- POSTGRES_DB=${DB_NAME:-django_db}
|
|
- POSTGRES_USER=${DB_USER:-django_user}
|
|
- POSTGRES_PASSWORD=${DB_PASSWORD:-django_password}
|
|
networks:
|
|
- dokploy-network
|
|
|
|
redis:
|
|
image: redis:7-alpine
|
|
volumes:
|
|
- "../files/redis_data:/data"
|
|
networks:
|
|
- dokploy-network
|
|
|
|
networks:
|
|
dokploy-network:
|
|
external: true |