Refactor Docker Compose configuration to enhance network management
- Removed network_mode settings for services and replaced them with a dedicated portal-network. - Ensured all services are connected to the new bridge network for improved communication and organization.
This commit is contained in:
parent
8b855ca371
commit
638638ea89
@ -6,9 +6,10 @@ services:
|
||||
frontend:
|
||||
image: portal-frontend:latest
|
||||
container_name: portal-frontend
|
||||
network_mode: bridge
|
||||
ports:
|
||||
- "127.0.0.1:3000:3000" # Only accessible from localhost for security
|
||||
- "127.0.0.1:3000:3000"
|
||||
networks:
|
||||
- portal-network
|
||||
environment:
|
||||
- NODE_ENV=production
|
||||
- PORT=3000
|
||||
@ -27,9 +28,10 @@ services:
|
||||
backend:
|
||||
image: portal-backend:latest
|
||||
container_name: portal-backend
|
||||
network_mode: bridge
|
||||
ports:
|
||||
- "127.0.0.1:4000:4000"
|
||||
networks:
|
||||
- portal-network
|
||||
environment:
|
||||
- NODE_ENV=production
|
||||
- PORT=4000
|
||||
@ -76,9 +78,8 @@ services:
|
||||
database:
|
||||
image: postgres:17-alpine
|
||||
container_name: portal-database
|
||||
network_mode: bridge
|
||||
ports:
|
||||
- "127.0.0.1:5432:5432" # Only accessible from localhost for security
|
||||
networks:
|
||||
- portal-network
|
||||
environment:
|
||||
- POSTGRES_DB=${POSTGRES_DB}
|
||||
- POSTGRES_USER=${POSTGRES_USER}
|
||||
@ -96,9 +97,8 @@ services:
|
||||
cache:
|
||||
image: redis:7-alpine
|
||||
container_name: portal-cache
|
||||
network_mode: bridge
|
||||
ports:
|
||||
- "127.0.0.1:6379:6379" # Only accessible from localhost for security
|
||||
networks:
|
||||
- portal-network
|
||||
volumes:
|
||||
- redis_data:/data
|
||||
restart: unless-stopped
|
||||
@ -113,3 +113,8 @@ volumes:
|
||||
driver: local
|
||||
redis_data:
|
||||
driver: local
|
||||
|
||||
networks:
|
||||
portal-network:
|
||||
driver: bridge
|
||||
name: portal-network
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user