Skip to content

Commit

Permalink
feat: add rabbitmq in a container
Browse files Browse the repository at this point in the history
  • Loading branch information
omar-besbes committed Feb 16, 2024
1 parent bf13da8 commit aceb2d9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
16 changes: 14 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,17 @@ version: '3.8'
name: database-synchronization-app

services:
rabbitmq:
image: rabbitmq:management
restart: on-failure
ports:
- "15672:15672" # RabbitMQ management UI
networks:
- app_network

head_office_db:
image: postgres:16
restart: on-failure
environment:
- POSTGRES_PASSWORD=/run/secrets/db_password
- POSTGRES_USER=/run/secrets/db_username
Expand All @@ -24,10 +33,11 @@ services:
context: .
args:
office_type: head
restart: on-failure
env_file:
- apps/head/.env.example
environment:
- RABBITMQ_URL=${RABBITMQ_URL:?}
- RABBITMQ_URL=amqp://guest:guest@rabbitmq:5672
- DB_TYPE=postgres
- DB_HOST=head_office_db
- DB_PORT=5432
Expand All @@ -45,6 +55,7 @@ services:

branch_office_db:
image: postgres:16
restart: on-failure
environment:
- POSTGRES_PASSWORD=/run/secrets/db_password
- POSTGRES_USER=/run/secrets/db_username
Expand All @@ -64,10 +75,11 @@ services:
context: .
args:
office_type: branch
restart: on-failure
env_file:
- apps/branch/.env.example
environment:
- RABBITMQ_URL=${RABBITMQ_URL:?}
- RABBITMQ_URL=amqp://guest:guest@rabbitmq:5672
- DB_TYPE=postgres
- DB_HOST=branch_office_db
- DB_PORT=5432
Expand Down
1 change: 1 addition & 0 deletions scripts/generate_ssl_certificates.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ cd "$TEMP_DIR" || exit
# Generate SSL certificates
openssl req -new -x509 -days 365 -nodes -text -out server.crt \
-keyout server.key -subj "/C=$COUNTRY_CODE/ST=$STATE/L=$CITY/O=$ORGANIZATION/CN=$COMMON_NAME"
cp server.crt root.crt
chmod og-rws server.key # Configure file permission. This is required by postgres, see https://www.postgresql.org/docs/current/ssl-tcp.html#SSL-SETUP

# Print the directory of ssl
Expand Down

0 comments on commit aceb2d9

Please sign in to comment.