Repository navigation
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
61 lines (58 loc) · 1.89 KB
/
Copy pathdocker-compose.yaml
File metadata and controls
61 lines (58 loc) · 1.89 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
services:
redis:
image: redis:latest
# Bound memory so a flood of secrets can't exhaust the host. Secrets are
# TTL'd and must never be silently dropped, so use noeviction: once the cap
# is hit, new writes are rejected (surfacing pressure) rather than evicting
# live secrets. Tune REDIS_MAXMEMORY to the host.
#
# Secrets survive restarts through an AOF synced before each write is
# acknowledged (SPECIFICATION.md 6.2), so a burn can't be undone by a crash.
# RDB save points stay off because restoring an older snapshot could bring a
# burned secret back. The low rewrite threshold limits how long deleted
# entries remain in the log on small instances.
command:
- redis-server
- --maxmemory
- ${REDIS_MAXMEMORY:-256mb}
- --maxmemory-policy
- noeviction
- --save
- ''
- --appendonly
- 'yes'
- --appendfsync
- always
- --auto-aof-rewrite-min-size
- 1mb
- --loglevel
- warning
volumes:
- redis_data:/data
server:
build:
context: .
dockerfile: Dockerfile.server
environment:
- REDIS_URL=redis://redis:6379
- PORT=${SERVER_PORT:-4321}
# Protects verification hashes, delete tokens, IP restrictions and webhook URLs at rest in Redis.
- ENCRYPTION_KEY=${ENCRYPTION_KEY:?ENCRYPTION_KEY is required (e.g. openssl rand -base64 32)}
# Comma-separated keys kept for reading existing entries while rotating ENCRYPTION_KEY (see README).
- ENCRYPTION_PREVIOUS_KEYS=${ENCRYPTION_PREVIOUS_KEYS:-}
ports:
- '${SERVER_PORT:-4321}:${SERVER_PORT:-4321}'
depends_on:
- redis
web:
build:
context: .
dockerfile: Dockerfile.web
environment:
- API_URL=${API_URL:-http://localhost:${SERVER_PORT:-4321}}
ports:
- '${WEB_PORT:-80}:80'
depends_on:
- server
volumes:
redis_data: