Skip to content

Commit

Permalink
docker-swarm: [WIP] compose
Browse files Browse the repository at this point in the history
  • Loading branch information
aboueleyes committed May 5, 2024
1 parent 0d11a26 commit a28b00b
Showing 1 changed file with 34 additions and 26 deletions.
60 changes: 34 additions & 26 deletions compose.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# This docker compose is for testing a real production env locally..
# Simulates a network etc.
version: '3.7'

services:
# ----- GENERAL SERVICES -------
Expand All @@ -12,61 +13,68 @@ services:
retries: 3
networks:
- microservices
ports:
- "5672:5672"
- "15672:15672"
# ports:
# - "5672:5672"
# - "15672:15672"

# ----- JOBS MICROSERVICE -------
service_jobs:
build: ./services/jobs
image: ahmad45123/workup:service_jobs
depends_on:
jobs_db:
condition: service_healthy
service_mq:
condition: service_healthy
- jobs_db
- service_mq
networks:
- microservices
- jobs

# ----- PAYMENTS MICROSERVICE -------
service_payments:
build: ./services/payments
image: ahmad45123/workup:service_payments
depends_on:
payments_db:
condition: service_healthy
service_mq:
condition: service_started
- payments_db
- service_mq
networks:
- microservices
- payments

# ----- PAYMENTS MICROSERVICE -------
service_contracts:
image: ahmad45123/workup:service_contracts
depends_on:
- contracts_db
- service_mq
networks:
- microservices

jobs_db:
image: cassandra:4.0.7
networks:
- jobs # only accessible by the jobs service
volumes:
- ./services/jobs/cassandra-config/cassandra.yaml:/etc/cassandra/cassandra.yaml
healthcheck:
test: [ "CMD", "cqlsh", "-e", "describe keyspaces" ]
interval: 20s
timeout: 10s
retries: 60
ports:
- "9042:9042"

contracts_db:
image: cassandra:4.0.7
healthcheck:
test: [ "CMD", "cqlsh", "-e", "describe keyspaces" ]
interval: 20s
timeout: 10s
retries: 60

payments_db:
image: postgres:latest
environment:
POSTGRES_PASSWORD: payments_password
POSTGRES_USER: payments_user
POSTGRES_DB: payments_database
ports:
- "5432:5432"

healthcheck:
test: ["CMD", "pg_isready"]
interval: 20s
timeout: 10s
retries: 10

networks:
microservices:
driver: bridge
jobs:
driver: bridge
payments:
driver: bridge
driver: overlay

0 comments on commit a28b00b

Please sign in to comment.