add notification server to compose file

This commit is contained in:
2025-05-04 10:30:42 +03:30
parent 43bd16c5a3
commit 314645761b
2 changed files with 67 additions and 5 deletions

View File

@@ -3,4 +3,12 @@ PROJECT_PATH="./laravel"
POSTGRES_USER="" POSTGRES_USER=""
POSTGRES_DB="" POSTGRES_DB=""
POSTGRES_PASSWORD="" POSTGRES_PASSWORD=""
NOTIFICATION_SERVER_PATH=""
NOTIFICATION_SERVER_DB=""
NOTIFICATION_SERVER_USER=""
NOTIFICATION_SERVER_PASSWORD=""
NOTIFICATION_SERVER_DB_SSL=""
NOTIFICATION_SERVER_DB_SYNC=""
NOTIFICATION_SERVER_PORT=""

View File

@@ -1,5 +1,5 @@
services: services:
postgres: backend_db:
image: postgres:17-alpine3.21 image: postgres:17-alpine3.21
container_name: ${PROJECT_NAME}-pgsql container_name: ${PROJECT_NAME}-pgsql
ports: ports:
@@ -12,6 +12,24 @@ services:
- ./data:/var/lib/postgresql/data - ./data:/var/lib/postgresql/data
profiles: profiles:
- server - server
networks:
- notification
notification_db:
image: postgres:17-alpine3.21
container_name: notification_db
ports:
- "8070:5432"
environment:
POSTGRES_DB: ${NOTIFICATION_DB}
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
volumes:
- ./notification:/var/lib/postgresql/data
profiles:
- server
networks:
- notification
# redis: # redis:
# image: redis:7-alpine3.21 # image: redis:7-alpine3.21
@@ -23,8 +41,44 @@ services:
dockerfile: Dockerfile dockerfile: Dockerfile
container_name: ${PROJECT_NAME} container_name: ${PROJECT_NAME}
ports: ports:
- "8080:8000" - "8000:8000"
volumes: volumes:
- ./laravel:/var/www/${PROJECT_NAME} - ./laravel:/var/www/crm
profiles: profiles:
- server - server
networks:
- notification
depends_on:
- postgres
notification_server:
build:
context: ${NOTIFICATION_SERVER_PATH}
dockerfile: Dockerfile
container_name: notification-server
environment:
- NODE_ENV=production
- DB_HOST=notification_db
- DB_PORT=5432
- DB_USERNAME=${NOTIFICATION_SERVER_USER}
- DB_PASSWORD=${NOTIFICATION_SERVER_PASSWORD}
- DB_DATABASE=${NOTIFICATION_SERVER_DB}
- DB_SSL=${NOTIFICATION_SERVER_DB_SSL}
- DB_SYNC=${NOTIFICATION_SERVER_DB_SYNC}
- PORT=${NOTIFICATION_SERVER_PORT}
ports:
- "3023:3023"
volumes:
- ${NOTIFICATION_SERVER_PATH}:/var/www/crm-notification-server
profiles:
- server
networks:
- notification
depends_on:
- backend-db
- laravel
- notification_db
networks:
notification:
driver: bridge