Skip to content

Commit c1d0b49

Browse files
aboueleyesAhmad45123
authored andcommitted
docker-swarm: [WIP] compose
1 parent 1460819 commit c1d0b49

File tree

1 file changed

+37
-30
lines changed

1 file changed

+37
-30
lines changed

compose.yaml

Lines changed: 37 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# This docker compose is for testing a real production env locally..
22
# Simulates a network etc.
3+
version: '3.7'
34

45
services:
56
# ----- GENERAL SERVICES -------
@@ -12,9 +13,9 @@ services:
1213
retries: 3
1314
networks:
1415
- microservices
15-
ports:
16-
- "5672:5672"
17-
- "15672:15672"
16+
# ports:
17+
# - "5672:5672"
18+
# - "15672:15672"
1819

1920
service_redis:
2021
image: redis:latest
@@ -25,62 +26,68 @@ services:
2526
retries: 3
2627
networks:
2728
- microservices
28-
ports:
29-
- "6379:6379"
29+
# ports:
30+
# - "6379:6379"
3031

3132
# ----- JOBS MICROSERVICE -------
3233
service_jobs:
33-
build: ./services/jobs
34+
image: ahmad45123/workup:service_jobs
3435
depends_on:
35-
jobs_db:
36-
condition: service_healthy
37-
service_mq:
38-
condition: service_healthy
36+
- jobs_db
37+
- service_mq
3938
networks:
4039
- microservices
41-
- jobs
4240

4341
# ----- PAYMENTS MICROSERVICE -------
4442
service_payments:
45-
build: ./services/payments
43+
image: ahmad45123/workup:service_payments
4644
depends_on:
47-
payments_db:
48-
condition: service_healthy
49-
service_mq:
50-
condition: service_healthy
51-
service_redis:
52-
condition: service_healthy
45+
- payments_db
46+
- service_mq
47+
- service_redis
5348
networks:
5449
- microservices
55-
- payments
5650

51+
# ----- PAYMENTS MICROSERVICE -------
52+
service_contracts:
53+
image: ahmad45123/workup:service_contracts
54+
depends_on:
55+
- contracts_db
56+
- service_mq
57+
networks:
58+
- microservices
59+
5760
jobs_db:
5861
image: cassandra:4.0.7
59-
networks:
60-
- jobs # only accessible by the jobs service
6162
volumes:
6263
- ./services/jobs/cassandra-config/cassandra.yaml:/etc/cassandra/cassandra.yaml
6364
healthcheck:
6465
test: [ "CMD", "cqlsh", "-e", "describe keyspaces" ]
6566
interval: 20s
6667
timeout: 10s
6768
retries: 60
68-
ports:
69-
- "9042:9042"
69+
70+
contracts_db:
71+
image: cassandra:4.0.7
72+
healthcheck:
73+
test: [ "CMD", "cqlsh", "-e", "describe keyspaces" ]
74+
interval: 20s
75+
timeout: 10s
76+
retries: 60
7077

7178
payments_db:
7279
image: postgres:latest
7380
environment:
7481
POSTGRES_PASSWORD: payments_password
7582
POSTGRES_USER: payments_user
7683
POSTGRES_DB: payments_database
77-
ports:
78-
- "5432:5432"
84+
85+
healthcheck:
86+
test: ["CMD", "pg_isready"]
87+
interval: 20s
88+
timeout: 10s
89+
retries: 10
7990

8091
networks:
8192
microservices:
82-
driver: bridge
83-
jobs:
84-
driver: bridge
85-
payments:
86-
driver: bridge
93+
driver: overlay

0 commit comments

Comments
 (0)