fix: Remove port exposure for production deployment
- Remove port bindings from base compose (production) - Keep ports only in dev override - Remove obsolete version attribute Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
16275b3a9b
commit
9b815a90d6
|
|
@ -1,5 +1,3 @@
|
||||||
version: "3.8"
|
|
||||||
|
|
||||||
# Development overrides - use with: docker compose -f docker-compose.yml -f docker-compose.dev.yml up
|
# Development overrides - use with: docker compose -f docker-compose.yml -f docker-compose.dev.yml up
|
||||||
|
|
||||||
services:
|
services:
|
||||||
|
|
@ -12,9 +10,6 @@ services:
|
||||||
- "6379:6379"
|
- "6379:6379"
|
||||||
|
|
||||||
backend:
|
backend:
|
||||||
build:
|
|
||||||
context: ./backend
|
|
||||||
dockerfile: Dockerfile
|
|
||||||
volumes:
|
volumes:
|
||||||
# Mount source for hot reload
|
# Mount source for hot reload
|
||||||
- ./backend/app:/app/app:ro
|
- ./backend/app:/app/app:ro
|
||||||
|
|
@ -30,13 +25,13 @@ services:
|
||||||
|
|
||||||
frontend:
|
frontend:
|
||||||
build:
|
build:
|
||||||
context: ./frontend
|
|
||||||
dockerfile: Dockerfile
|
|
||||||
args:
|
args:
|
||||||
- NEXT_PUBLIC_API_URL=http://localhost:8000/api
|
- NEXT_PUBLIC_API_URL=http://localhost:8000/api
|
||||||
ports:
|
ports:
|
||||||
- "3000:3000"
|
- "3000:3000"
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
|
swag-internal:
|
||||||
|
driver: bridge
|
||||||
traefik-public:
|
traefik-public:
|
||||||
driver: bridge # Override external for local dev
|
driver: bridge # Override external for local dev
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,3 @@
|
||||||
version: "3.8"
|
|
||||||
|
|
||||||
services:
|
services:
|
||||||
# PostgreSQL Database
|
# PostgreSQL Database
|
||||||
db:
|
db:
|
||||||
|
|
@ -19,10 +17,8 @@ services:
|
||||||
interval: 5s
|
interval: 5s
|
||||||
timeout: 5s
|
timeout: 5s
|
||||||
retries: 5
|
retries: 5
|
||||||
ports:
|
|
||||||
- "5432:5432" # Expose for local dev, remove in production
|
|
||||||
|
|
||||||
# Redis for sessions/cache (optional)
|
# Redis for sessions/cache
|
||||||
redis:
|
redis:
|
||||||
image: redis:7-alpine
|
image: redis:7-alpine
|
||||||
container_name: swag-redis
|
container_name: swag-redis
|
||||||
|
|
@ -31,8 +27,6 @@ services:
|
||||||
- swag-redis-data:/data
|
- swag-redis-data:/data
|
||||||
networks:
|
networks:
|
||||||
- swag-internal
|
- swag-internal
|
||||||
ports:
|
|
||||||
- "6379:6379" # Expose for local dev
|
|
||||||
|
|
||||||
# FastAPI Backend
|
# FastAPI Backend
|
||||||
backend:
|
backend:
|
||||||
|
|
@ -54,7 +48,6 @@ services:
|
||||||
- DESIGNS_PATH=/app/designs
|
- DESIGNS_PATH=/app/designs
|
||||||
- CONFIG_PATH=/app/config
|
- CONFIG_PATH=/app/config
|
||||||
volumes:
|
volumes:
|
||||||
# Mount designs from mycopunk-swag repo
|
|
||||||
- ${DESIGNS_PATH:-../mycopunk-swag/designs}:/app/designs:ro
|
- ${DESIGNS_PATH:-../mycopunk-swag/designs}:/app/designs:ro
|
||||||
- ${CONFIG_PATH:-../mycopunk-swag/config}:/app/config:ro
|
- ${CONFIG_PATH:-../mycopunk-swag/config}:/app/config:ro
|
||||||
depends_on:
|
depends_on:
|
||||||
|
|
@ -63,8 +56,6 @@ services:
|
||||||
networks:
|
networks:
|
||||||
- swag-internal
|
- swag-internal
|
||||||
- traefik-public
|
- traefik-public
|
||||||
ports:
|
|
||||||
- "8000:8000" # Expose for local dev
|
|
||||||
labels:
|
labels:
|
||||||
- "traefik.enable=true"
|
- "traefik.enable=true"
|
||||||
- "traefik.http.routers.swag-api.rule=Host(`swag.mycofi.earth`) && PathPrefix(`/api`)"
|
- "traefik.http.routers.swag-api.rule=Host(`swag.mycofi.earth`) && PathPrefix(`/api`)"
|
||||||
|
|
@ -89,8 +80,6 @@ services:
|
||||||
networks:
|
networks:
|
||||||
- swag-internal
|
- swag-internal
|
||||||
- traefik-public
|
- traefik-public
|
||||||
ports:
|
|
||||||
- "3000:3000" # Expose for local dev
|
|
||||||
labels:
|
labels:
|
||||||
- "traefik.enable=true"
|
- "traefik.enable=true"
|
||||||
- "traefik.http.routers.swag-web.rule=Host(`swag.mycofi.earth`)"
|
- "traefik.http.routers.swag-web.rule=Host(`swag.mycofi.earth`)"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue