generated from spatie/package-skeleton-php
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
79 lines (72 loc) · 1.86 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
version: '3.9'
x-kong-config: &kong-env
KONG_DATABASE: postgres
KONG_PG_DATABASE: ${KONG_PG_DATABASE:-kong}
KONG_PG_HOST: kong-database
KONG_PG_USER: ${POSTGRES_USER:-kong}
KONG_PG_PASSWORD_FILE: /run/secrets/kong_postgres_password
services:
kong-migrations:
image: kong/kong-gateway:3.6.1.8
command: kong migrations bootstrap
depends_on:
- kong-database
environment:
<<: *kong-env
secrets:
- kong_postgres_password
networks:
- kong-net
restart: on-failure
kong-migrations-up:
image: kong/kong-gateway:3.6.1.8
command: kong migrations up && kong migrations finish
depends_on:
- kong-database
environment:
<<: *kong-env
secrets:
- kong_postgres_password
networks:
- kong-net
restart: on-failure
kong-gateway:
image: kong/kong-gateway:3.6.1.8
user: "${KONG_USER:-kong}"
networks:
- kong-net
environment:
<<: *kong-env
KONG_PROXY_ACCESS_LOG: /dev/stdout
KONG_ADMIN_ACCESS_LOG: /dev/stdout
KONG_PROXY_ERROR_LOG: /dev/stderr
KONG_ADMIN_ERROR_LOG: /dev/stderr
KONG_ADMIN_LISTEN: 0.0.0.0:${KONG_ADMIN_PORT:-8001}
KONG_PROXY_LISTEN: 0.0.0.0:${KONG_PROXY_PORT:-8000}
secrets:
- kong_postgres_password
ports:
- '${KONG_PROXY_PORT:-8000}:8000'
- '${KONG_ADMIN_PORT:-8001}:8001'
depends_on:
- kong-database
healthcheck:
test: ["CMD", "kong", "health"]
interval: 10s
timeout: 10s
retries: 10
restart: on-failure:5
kong-database:
image: postgres:13
environment:
- POSTGRES_DB=${KONG_PG_DATABASE:-kong}
- POSTGRES_USER=${POSTGRES_USER:-kong}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-password}
networks:
- kong-net
networks:
kong-net:
external: true
secrets:
kong_postgres_password:
file: .config/POSTGRES_PASSWORD