-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdocker-compose.yml
134 lines (122 loc) · 3.4 KB
/
docker-compose.yml
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
# docker-compose build cloudbanking-core
# docker-compose up
version: "3"
services:
# Main Microservice. That expose /api
cloudbanking-core:
# Name of container to create
container_name: cloudbanking-core
image: pepitoenpeligro/cloudbanking-core
# The file is in . and the dockerfile is Dockerfile.core
# build:
# context: .
# dockerfile: Dockerfile.core
# Exposing port 3030
ports:
- "3030:3030"
depends_on:
- cloudbanking-account
- cloudbanking-card
- cloudbanking-funds
# Creating a network. It will be useful for connecting
# multiple microservices here
networks:
- proxynet
extra_hosts:
# To comunicate host with docker container
- "host.docker.internal:host-gateway"
cloudbanking-account:
container_name: cloudbanking-account
image: pepitoenpeligro/cloudbanking-account
# build:
# context: .
# dockerfile: Dockerfile.account
ports:
- "3031:3031"
networks:
- proxynet
extra_hosts:
- "host.docker.internal:host-gateway"
cloudbanking-card:
container_name: cloudbanking-card
image: pepitoenpeligro/cloudbanking-card
# build:
# context: ./card
# dockerfile: Dockerfile.cards
ports:
- "3032:3032"
networks:
- proxynet
extra_hosts:
- "host.docker.internal:host-gateway"
cloudbanking-funds:
container_name: cloudbanking-funds
image: pepitoenpeligro/cloudbanking-funds
ports:
- 3033:3033
networks:
- proxynet
# - app-network
extra_hosts:
- "host.docker.internal:host-gateway"
cloudbanking-loans:
container_name: cloudbanking-loans
build:
context: ./loans
dockerfile: loans.Dockerfile
ports:
- "3034:3034"
networks:
- proxynet
extra_hosts:
- "host.docker.internal:host-gateway"
database:
image: mongo:3.2
container_name: mongo
restart: unless-stopped
env_file: .env
environment:
MONGODB_USER: pepito
MONGODB_PASS: pepitopass
MONGO_INITDB_ROOT_USERNAME: pepito
MONGO_INITDB_ROOT_PASSWORD: pepitopass
MONGODB_DATABASE: loans
MONGODB_PORT_NUMBER: 27017
ports:
- "27017:27017"
volumes:
- ./data:/data/db
networks:
- proxynet
extra_hosts:
- "host.docker.internal:host-gateway"
nginx:
image: nginx:alpine
ports:
- 80:80
- 443:443
volumes:
- $PWD/conf/nginx.conf:/etc/nginx/conf.d/default.conf
- ./data/certbot/conf:/etc/letsencrypt
- ./data/certbot/www:/var/www/certbot
- /etc/letsencrypt/live/pepecordoba.site/fullchain.pem:/etc/letsencrypt/live/pepecordoba.site/fullchain.pem
- /etc/letsencrypt/live/pepecordoba.site/privkey.pem:/etc/letsencrypt/live/pepecordoba.site/privkey.pem
depends_on:
- cloudbanking-core
networks:
- proxynet
extra_hosts:
- "host.docker.internal:host-gateway"
command: "/bin/sh -c 'while :; do sleep 6h & wait $${!}; nginx -s reload; done & nginx -g \"daemon off;\"'"
certbot:
image: certbot/certbot
restart: unless-stopped
volumes:
- ./data/certbot/conf:/etc/letsencrypt
- ./data/certbot/www:/var/www/certbot
entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew; sleep 12h & wait $${!}; done;'"
networks:
proxynet:
name: custom_network
app-network:
driver: bridge