Repository navigation
Expand file tree
/
Copy pathdocker-compose.prod.yaml
More file actions
105 lines (99 loc) · 2.72 KB
/
Copy pathdocker-compose.prod.yaml
File metadata and controls
105 lines (99 loc) · 2.72 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
# Cliente (Internet) → Puerto 80/443 (Nginx) → localhost:3000/8443 (Servicios Docker)
services:
postgres:
image: postgres:latest
restart: always
container_name: fidechat-keycloak-postgres
env_file:
- .env
environment:
POSTGRES_USER: ${KC_DB_USERNAME:?error}
POSTGRES_PASSWORD: ${KC_DB_PASSWORD:?error}
POSTGRES_DB: ${KC_DB_NAME:-keycloak}
ports:
- "127.0.0.1:${DB_PORT:-5432}:5432"
healthcheck:
test: ["CMD-SHELL", "sh -c 'pg_isready -U ${KC_DB_USERNAME} -d ${KC_DB_NAME:-keycloak}'"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
volumes:
- pg_keycloak_data:/var/lib/postgresql/data
networks:
- fidechat-network
deploy:
resources:
limits:
memory: 1G
keycloak:
image: quay.io/keycloak/keycloak:latest
restart: always
container_name: fidechat-keycloak
env_file:
- .env
environment:
KC_DB: postgres
KC_DB_URL_DATABASE:
KC_DB_USERNAME: ${KC_DB_USERNAME:-${KC_DB_USERNAME:?error}}
KC_DB_PASSWORD: ${KC_DB_PASSWORD:-${KC_DB_PASSWORD:?error}}
KC_HEALTH_ENABLED: "true"
KC_METRICS_ENABLED: "true"
KC_DB_URL: ${KC_DB_URL:-jdbc:postgresql://postgres:5432/${KC_DB_NAME:-keycloak}}
# Production settings
KC_HOSTNAME: ${KC_HOSTNAME:?error}
KC_HOSTNAME_STRICT: "true"
KC_HTTP_ENABLED: "true"
KC_HOSTNAME_STRICT_HTTPS: "true"
KC_BOOTSTRAP_ADMIN_USERNAME: ${KC_BOOTSTRAP_ADMIN_USERNAME:?error}
KC_BOOTSTRAP_ADMIN_PASSWORD: ${KC_BOOTSTRAP_ADMIN_PASSWORD:?error}
KC_HTTP_RELATIVE_PATH: ${KC_HTTP_RELATIVE_PATH:?error}
# KC_HOSTNAME_ADMIN: ${KC_HOSTNAME_ADMIN:?error}
KC_PROXY: edge
depends_on:
postgres:
condition: service_healthy
ports:
- "${KC_PORT:-8080}:8080"
command: start
# volumes:
# - keycloak_certs:/opt/keycloak/conf/certs
networks:
- fidechat-network
deploy:
resources:
limits:
memory: 2G
backend:
build:
context: .
dockerfile: dockerfile.prod
container_name: fidechat-backend
restart: always
env_file:
- .env
depends_on:
# oracle:
# condition: service_healthy
keycloak:
condition: service_started
ports:
- "${API_PORT:-8080}:8080"
networks:
- fidechat-network
# healthcheck:
# test: ["CMD", "curl", "-f", "http://localhost:${API_PORT:-8080}/health"]
# interval: 30s
# timeout: 10s
# retries: 3
# start_period: 40s todos lmfao
# deploy:
# resources:
# limits:
# memory: 1G
# cpus: '0.5'
networks:
fidechat-network:
external: true
volumes:
pg_keycloak_data: