Update Docker Compose configuration to use host network mode for services

- Changed network configuration for frontend, backend, database, and cache services to use host network mode.
- Removed port mappings to enhance service communication and simplify network management.
This commit is contained in:
T. Narantuya 2025-08-29 18:41:35 +09:00
parent c625b978d9
commit fd4bef3ffe

View File

@ -6,8 +6,7 @@ services:
frontend: frontend:
image: portal-frontend:latest image: portal-frontend:latest
container_name: portal-frontend container_name: portal-frontend
ports: network_mode: host
- "127.0.0.1:3000:3000"
environment: environment:
- NODE_ENV=production - NODE_ENV=production
- PORT=3000 - PORT=3000
@ -26,11 +25,7 @@ services:
backend: backend:
image: portal-backend:latest image: portal-backend:latest
container_name: portal-backend container_name: portal-backend
ports: network_mode: host
- "127.0.0.1:4000:4000"
links:
- database
- cache
environment: environment:
- NODE_ENV=production - NODE_ENV=production
- PORT=4000 - PORT=4000
@ -79,6 +74,7 @@ services:
database: database:
image: postgres:17-alpine image: postgres:17-alpine
container_name: portal-database container_name: portal-database
network_mode: host
environment: environment:
- POSTGRES_DB=${POSTGRES_DB} - POSTGRES_DB=${POSTGRES_DB}
- POSTGRES_USER=${POSTGRES_USER} - POSTGRES_USER=${POSTGRES_USER}
@ -96,6 +92,7 @@ services:
cache: cache:
image: redis:7-alpine image: redis:7-alpine
container_name: portal-cache container_name: portal-cache
network_mode: host
volumes: volumes:
- redis_data:/data - redis_data:/data
restart: unless-stopped restart: unless-stopped