mirror of
https://github.com/thecyberlearn/modern-django-starter.git
synced 2026-08-18 08:52:55 +00:00
Fix Dokploy port configuration with unique Traefik labels
Based on DOKPLOY.md documentation: - Update Traefik router/service names to be unique (dt-netcoptech-prod) - This prevents conflicts with other services on the same Dokploy server - Add alternative compose file without Traefik labels for Domain UI method - Both approaches should resolve port/routing issues Try Method A first (current file), then Method B if needed.
This commit is contained in:
parent
5845f9ee13
commit
db923db446
47
docker-compose.dokploy-domain-ui.yml
Normal file
47
docker-compose.dokploy-domain-ui.yml
Normal file
@ -0,0 +1,47 @@
|
||||
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
|
||||
|
||||
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
|
||||
@ -25,10 +25,10 @@ services:
|
||||
- dokploy-network
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.http.routers.django-app.rule=Host(`dt.netcoptech.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"
|
||||
- "traefik.http.routers.dt-netcoptech-prod.rule=Host(`dt.netcoptech.com`)"
|
||||
- "traefik.http.routers.dt-netcoptech-prod.entrypoints=websecure"
|
||||
- "traefik.http.routers.dt-netcoptech-prod.tls.certResolver=letsencrypt"
|
||||
- "traefik.http.services.dt-netcoptech-prod.loadbalancer.server.port=8000"
|
||||
|
||||
db:
|
||||
image: postgres:15-alpine
|
||||
|
||||
Loading…
Reference in New Issue
Block a user