-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
160 lines (148 loc) · 3.97 KB
/
docker-compose.yml
File metadata and controls
160 lines (148 loc) · 3.97 KB
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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
version: '3.7'
volumes:
kong_data: {}
users_data: {}
networks: #Red interna para comunicar los servicios (“Services on the same network can communicate with each other using their name”)
kong-net:
services:
#######################################
# Postgres: The database used by Kong
#######################################
kong-database:
image: postgres:9.6
container_name: kong-postgres
restart: on-failure
networks:
- kong-net
volumes:
- kong_data:/var/lib/postgresql/data
environment:
POSTGRES_USER: kong
POSTGRES_PASSWORD: ${KONG_PG_PASSWORD:-kong}
POSTGRES_DB: kong
ports:
- "5432:5432"
healthcheck:
test: ["CMD", "pg_isready", "-U", "kong"]
interval: 30s
timeout: 30s
retries: 3
#######################################
# Kong database migration
#######################################
kong-migration:
image: ${KONG_DOCKER_TAG:-kong:latest}
command: kong migrations bootstrap
networks:
- kong-net
restart: on-failure
environment:
KONG_DATABASE: postgres
KONG_PG_HOST: kong-database
KONG_PG_DATABASE: kong
KONG_PG_USER: kong
KONG_PG_PASSWORD: ${KONG_PG_PASSWORD:-kong}
depends_on:
kong-database:
condition: service_healthy
#######################################
# Kong: The API Gateway
#######################################
kong:
image: ${KONG_DOCKER_TAG:-kong:latest}
restart: on-failure
networks:
- kong-net
environment:
KONG_DATABASE: postgres
KONG_PG_HOST: kong-database
KONG_PG_DATABASE: kong
KONG_PG_USER: kong
KONG_PG_PASSWORD: ${KONG_PG_PASSWORD:-kong}
KONG_PROXY_LISTEN: 0.0.0.0:8000
KONG_PROXY_LISTEN_SSL: 0.0.0.0:8443
KONG_ADMIN_LISTEN: 0.0.0.0:8001
depends_on:
kong-database:
condition: service_healthy
healthcheck:
test: ["CMD", "kong", "health"]
interval: 10s
timeout: 10s
retries: 10
ports:
- "8000:8000"
- "8001:8001"
- "8443:8443"
- "8444:8444"
#######################################
# Konga database prepare
#######################################
# konga-prepare:
# image: pantsel/konga:latest
# command: "-c prepare -a postgres -u postgresql://kong:${KONG_PG_PASSWORD:-kong}@kong-database:5432/konga"
# networks:
# - kong-net
# restart: on-failure
# depends_on:
# kong-database:
# condition: service_healthy
#######################################
# Konga: Kong GUI
#######################################
# konga:
# image: pantsel/konga:latest
# restart: always
# networks:
# - kong-net
# environment:
# DB_ADAPTER: postgres
# DB_URI: postgresql://kong:${KONG_PG_PASSWORD:-kong}@kong-database:5432/konga
# NODE_ENV: production
# depends_on:
# kong-database:
# condition: service_healthy
# ports:
# - "1337:1337"
front:
image: my-angular-app
build:
context: ./src/front
dockerfile: ./Dockerfile
restart: unless-stopped
ports:
- "4200:80"
networks:
- kong-net
Vinos-API:
image: tiendavinos-api-image
build:
context: ./src/api/users
dockerfile: ./Dockerfile
restart: unless-stopped
ports:
- 8080:8080
networks: # Networks to join
- kong-net
environment:
SPRING_DATASOURCE_URL: jdbc:mysql://TiendaVinos-database:3306/TiendaVinos?createDatabaseIfNotExist=true
depends_on:
- TiendaVinos-database
TiendaVinos-database:
image: mysql #Usamos imagen del respositorio ya creada
hostname: TiendaVinos-database
cap_add:
- SYS_NICE
restart: unless-stopped
ports:
- "3307:3306"
networks:
- kong-net
volumes:
- users_data:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: password
MYSQL_USER: sqluser
MYSQL_PASSWORD: password
MYSQL_DATABASE: TiendaVinos
MYSQL_ROOT_HOST: '%'