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_PASSWORD=""
NOTIFICATION_SERVER_PATH="./notification_server"
NOTIFICATION_SERVER_PATH="./notification"
NOTIFICATION_SERVICE_URL="http://host.docker.internal:8888/server"
NOTIFICATION_SERVER_DB="notification_db"
NOTIFICATION_SERVER_USER="notification_user"

View File

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