-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
119 lines (114 loc) · 3.27 KB
/
Copy pathdocker-compose.yml
File metadata and controls
119 lines (114 loc) · 3.27 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
services:
postgres:
image: postgres:17-alpine
container_name: keylo-postgres
restart: unless-stopped
environment:
POSTGRES_USER: keylo_user
POSTGRES_PASSWORD_FILE: /run/secrets/.database_password
POSTGRES_DB: keylo
secrets:
- source: database_password
target: .database_password
ports:
- "${POSTGRES_PORT:-5432}:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U keylo_user -d keylo"]
interval: 10s
timeout: 5s
retries: 5
networks:
- keylo_db_network
redis:
image: redis:8.6.2-alpine
container_name: keylo-redis
restart: unless-stopped
command: ["redis-server", "--aclfile", "/run/secrets/.redis.acl", "--appendonly", "yes"]
volumes:
- redis_data:/data
secrets:
- source: redis_acl
target: .redis.acl
healthcheck:
test: ["CMD-SHELL", "redis-cli ping 2>&1 | grep -E 'PONG|NOAUTH'"]
interval: 10s
timeout: 5s
retries: 5
networks:
- keylo_redis_network
keylo:
build:
context: .
dockerfile: Dockerfile
image: keylo-local:dev
container_name: keylo-service
restart: unless-stopped
environment:
TZ: UTC
DATABASE_URL: postgres://keylo_user@postgres:5432/keylo
SERVER_PORT: ${SERVER_PORT:-2345}
ENVIRONMENT: ${ENVIRONMENT:-production}
ADMIN_CLIENT_ID: ${ADMIN_CLIENT_ID}
ADMIN_CLIENT_SECRET: ${ADMIN_CLIENT_SECRET:-}
ENABLE_SETUP_WIZARD: ${ENABLE_SETUP_WIZARD:-true}
REDIS_HOST: redis
REDIS_PORT: 6379
REDIS_USERNAME: keylo
REDIS_PASSWORD_ENC_FILE: /run/secrets/.redis_password.enc
REDIS_PASSWORD_KEY_FILE: /run/secrets/.redis_password.key
CORS_ALLOWED_ORIGINS: ${CORS_ALLOWED_ORIGINS:-http://localhost:5173,http://127.0.0.1:5173}
RUST_LOG: ${KEYLO_RUST_LOG:-keylo=debug,axum=info}
LOG_TO_FILE: ${LOG_TO_FILE:-true}
LOG_DIR: /app/logs
LOG_FILE_PREFIX: ${LOG_FILE_PREFIX:-keylo}
HTTP_LOG_BODY_MAX_BYTES: ${HTTP_LOG_BODY_MAX_BYTES:-8192}
ports:
- "${SERVER_PORT:-2345}:2345"
volumes:
- ./keys:/app/keys:ro
- ./logs:/app/logs
secrets:
- source: database_password_enc
target: .database_password.enc
- source: database_password_key
target: .database_password.key
- source: redis_password_enc
target: .redis_password.enc
- source: redis_password_key
target: .redis_password.key
networks:
- keylo_public_network
- keylo_db_network
- keylo_redis_network
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
volumes:
postgres_data:
redis_data:
secrets:
database_password:
file: ./.secrets/.database_password
database_password_enc:
file: ./.secrets/.database_password.enc
database_password_key:
file: ./.secrets/.database_password.key
redis_acl:
file: ./.secrets/.redis.acl
redis_password_enc:
file: ./.secrets/.redis_password.enc
redis_password_key:
file: ./.secrets/.redis_password.key
networks:
keylo_public_network:
driver: bridge
keylo_db_network:
driver: bridge
internal: true
keylo_redis_network:
driver: bridge
internal: true