use named docker volume

This commit is contained in:
2026-02-15 11:32:10 +03:30
parent 4cceeed29b
commit 6f699a5199
2 changed files with 13 additions and 3 deletions

View File

@@ -6,7 +6,7 @@ POSTGRES_USER=""
POSTGRES_DB="" POSTGRES_DB=""
POSTGRES_PASSWORD="" POSTGRES_PASSWORD=""
NOTIFICATION_SERVER_PATH="./notification_server" NOTIFICATION_SERVER_PATH="./notification"
NOTIFICATION_SERVICE_URL="http://host.docker.internal:8888/server" NOTIFICATION_SERVICE_URL="http://host.docker.internal:8888/server"
NOTIFICATION_SERVER_DB="notification_db" NOTIFICATION_SERVER_DB="notification_db"
NOTIFICATION_SERVER_USER="notification_user" NOTIFICATION_SERVER_USER="notification_user"

View File

@@ -3,6 +3,7 @@ services:
# image: postgres:17-alpine3.21 # image: postgres:17-alpine3.21
# container_name: backend_db # container_name: backend_db
# tty: true # tty: true
# restart: unless-stopped
# ports: # ports:
# - "8050:5432" # - "8050:5432"
# environment: # environment:
@@ -10,7 +11,7 @@ services:
# POSTGRES_USER: ${POSTGRES_USER} # POSTGRES_USER: ${POSTGRES_USER}
# POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} # POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
# volumes: # volumes:
# - ./data:/var/lib/postgresql/data # - backend_db_data:/var/lib/postgresql/data
# profiles: # profiles:
# - server # - server
# networks: # networks:
@@ -20,6 +21,7 @@ services:
image: docker.arvancloud.ir/postgres:17-alpine3.21 image: docker.arvancloud.ir/postgres:17-alpine3.21
container_name: notification_db container_name: notification_db
tty: true tty: true
restart: unless-stopped
ports: ports:
- "8070:5432" - "8070:5432"
environment: environment:
@@ -27,7 +29,7 @@ services:
POSTGRES_USER: ${NOTIFICATION_SERVER_USER} POSTGRES_USER: ${NOTIFICATION_SERVER_USER}
POSTGRES_PASSWORD: ${NOTIFICATION_SERVER_PASSWORD} POSTGRES_PASSWORD: ${NOTIFICATION_SERVER_PASSWORD}
volumes: volumes:
- ./notification:/var/lib/postgresql/data - notification_db_data:/var/lib/postgresql/data
profiles: profiles:
- server - server
networks: networks:
@@ -49,6 +51,7 @@ services:
dockerfile: Dockerfile dockerfile: Dockerfile
container_name: laravel container_name: laravel
tty: true tty: true
restart: unless-stopped
ports: ports:
- "9000:9000" - "9000:9000"
volumes: volumes:
@@ -74,6 +77,7 @@ services:
context: ${NOTIFICATION_SERVER_PATH} context: ${NOTIFICATION_SERVER_PATH}
dockerfile: Dockerfile dockerfile: Dockerfile
container_name: notification_server container_name: notification_server
restart: unless-stopped
environment: environment:
- NODE_ENV=production - NODE_ENV=production
- DB_HOST=notification_db - DB_HOST=notification_db
@@ -113,6 +117,12 @@ services:
networks: networks:
- crm_network - crm_network
volumes:
notification_db_data:
driver: local
# backend_db_data:
# driver: local
networks: networks:
crm_network: crm_network:
driver: bridge driver: bridge