-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
99 lines (89 loc) · 2.82 KB
/
docker-compose.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
version: '3.8' # defines the schema version for the file format
services: # abstract definition of a computing resource within an application
postgres: # name of service (container)
image: postgres:latest # image of service that fill be started in container. docker gives image of postgres.
restart: always # always restart container is it stops
environment: # creating environment variables
POSTGRES_DB: Bank # name of database
POSTGRES_USER: postgres # name of user
POSTGRES_PASSWORD: qrrqrr # password
ports: # define ports on which service will work
- "5433:5432" # 5433 is port system, 5432 port for container
redis:
image: "redis"
ports:
- "6379:6379"
environment:
- ALLOW_EMPTY_PASSWORD=yes
- REDIS_DISABLE_COMMANDS=FLUSHDB, FLUSHALL
rabbitmq:
image: rabbitmq:3-management
container_name: rabbitmq
ports:
- 5672:5672 # client port
- 15672:15672 # management UI
volumes:
- rabbitmq_data:/var/lib/rabbitmq
eureka-server:
build:
context: ./eureka-server
dockerfile: Dockerfile
container_name: eureka-server
ports:
- "8761:8761"
environment:
- EUREKA_CLIENT_REGISTER_WITH_EUREKA=false
- EUREKA_CLIENT_FETCH_REGISTRATIONS=false
user-service: # Spring backend service (this is a name of container)
build:
context: ./user-service
dockerfile: Dockerfile
restart: always
environment:
SPRING_DATASOURCE_URL: jdbc:postgresql://postgres:5432/Bank
SPRING_DATASOURCE_USERNAME: postgres
SPRING_DATASOURCE_PASSWORD: qrrqrr
ports:
- "8081:8081"
depends_on:
- postgres
- eureka-server
deposit-service:
build:
context: ./deposit-service
dockerfile: Dockerfile
restart: always
environment:
SPRING_DATASOURCE_URL: jdbc:postgresql://postgres:5432/Bank
SPRING_DATASOURCE_USERNAME: postgres
SPRING_DATASOURCE_PASSWORD: qrrqrr
ports:
- "8083:8083"
depends_on:
- postgres
- eureka-server
frontend: # React frontend service (name of container)
build: # specifies the way of building
context: ./front/bank-frontend # find the certain folder
dockerfile: Dockerfile # find dockerfile there
restart: always # always restarts when container is crashed
ports: # defines ports
- "3000:80" # Assuming nginx is serving on port 80
environment:
- REACT_APP_API_URL=http://backend:8081 # Use backend service name
pgadmin:
image: dpage/pgadmin4
container_name: pgadmin
restart: always
environment:
PGADMIN_DEFAULT_EMAIL: [email protected]
PGADMIN_DEFAULT_PASSWORD: admin
ports:
- "8085:80"
depends_on:
- postgres
volumes:
- pgadmin_data:/var/lib/pgadmin
volumes:
rabbitmq_data:
pgadmin_data: