Repository navigation
Expand file tree
/
Copy pathdocker-compose.dev.yml
More file actions
118 lines (113 loc) · 3.29 KB
/
Copy pathdocker-compose.dev.yml
File metadata and controls
118 lines (113 loc) · 3.29 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
services:
postgres:
image: postgres:14-alpine
container_name: synapse-postgres-dev
environment:
POSTGRES_USER: synapse
POSTGRES_PASSWORD: synapse
POSTGRES_DB: synapse
ports:
- "5432:5432"
volumes:
- postgres_dev_data:/var/lib/postgresql/data
# Provisions the restricted synapse_app role (NOBYPASSRLS) the app
# connects as below. Only runs on first init of an empty data volume.
- ./scripts/db-init:/docker-entrypoint-initdb.d:ro
healthcheck:
test: ["CMD-SHELL", "pg_isready -U synapse"]
interval: 5s
timeout: 5s
retries: 5
redis:
image: redis:7-alpine
container_name: synapse-redis-dev
ports:
- "6379:6379"
volumes:
- redis_dev_data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 5s
retries: 5
adminer:
image: adminer:latest
container_name: synapse-adminer
ports:
- "8080:8080"
depends_on:
postgres:
condition: service_healthy
environment:
ADMINER_DEFAULT_SERVER: postgres
vault:
image: hashicorp/vault:latest
container_name: synapse-vault-dev
ports:
- "8200:8200"
environment:
VAULT_DEV_ROOT_TOKEN_ID: "root"
VAULT_DEV_LISTEN_ADDRESS: "0.0.0.0:8200"
cap_add:
- IPC_LOCK
command: server -dev
app:
image: rust:latest
container_name: synapse-app-dev
working_dir: /app
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
vault:
condition: service_started
environment:
APP_ENV: development
SERVER_PORT: 3000
# Restricted, non-superuser role — see scripts/db-init/01-create-app-role.sql.
DATABASE_URL: postgres://synapse_app:synapse_app@postgres:5432/synapse
DATABASE_URL_TEMPLATE: postgres://synapse_app:{password}@postgres:5432/synapse
BACKUP_DATABASE_URL: postgres://synapse:synapse@postgres:5432/synapse
STELLAR_HORIZON_URL: https://horizon-testnet.stellar.org
VAULT_ADDR: http://vault:8200
VAULT_ROLE_ID: ""
VAULT_SECRET_ID: ""
REDIS_URL: redis://redis:6379
ANCHOR_WEBHOOK_SECRET: dev-secret
RUST_LOG: debug
LOG_FORMAT: text
# Keep development parity with production defaults while allowing local debugging.
DEFAULT_RATE_LIMIT: "10000"
WHITELIST_RATE_LIMIT: "100000"
DB_MIN_CONNECTIONS: "2"
DB_MAX_CONNECTIONS: "10"
DB_IDLE_TIMEOUT_SECS: "30"
DB_STATEMENT_TIMEOUT_MS: "30000"
DB_LONG_RUNNING_STATEMENT_TIMEOUT_MS: "120000"
ports:
- "3000:3000"
# Debug port for IDE debugger attachment (lldb-server / rust-gdb)
- "9229:9229"
deploy:
resources:
limits:
cpus: '2'
memory: 1G
volumes:
- ./src:/app/src
- ./migrations:/app/migrations
- ./Cargo.toml:/app/Cargo.toml
- ./Cargo.lock:/app/Cargo.lock
- cargo_registry:/usr/local/cargo/registry
- cargo_git:/usr/local/cargo/git
- target_cache:/app/target
command: >
bash -c "cargo install cargo-watch --locked 2>/dev/null || true &&
cargo watch -x 'run -- serve' -w src -w migrations"
volumes:
postgres_dev_data:
redis_dev_data:
cargo_registry:
cargo_git:
target_cache: