-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
105 lines (100 loc) · 3.03 KB
/
Copy pathdocker-compose.yml
File metadata and controls
105 lines (100 loc) · 3.03 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
name: modgate
services:
postgres:
image: postgres:16-alpine
environment:
POSTGRES_DB: ${MODGATE_POSTGRES_DB:-modgate}
POSTGRES_USER: ${MODGATE_POSTGRES_USER:-modgate}
POSTGRES_PASSWORD: ${MODGATE_POSTGRES_PASSWORD:?set MODGATE_POSTGRES_PASSWORD in .env}
volumes:
- modgate-postgres:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U \"$${POSTGRES_USER}\" -d \"$${POSTGRES_DB}\""]
interval: 10s
timeout: 5s
retries: 5
restart: unless-stopped
logging:
driver: json-file
options:
max-size: ${MODGATE_LOG_MAX_SIZE:-10m}
max-file: "${MODGATE_LOG_MAX_FILES:-5}"
modgate:
build:
context: .
dockerfile: Dockerfile
args:
MODGATE_SOURCE_REVISION: ${MODGATE_SOURCE_REVISION:-unknown}
MODGATE_SOURCE_STATE: ${MODGATE_SOURCE_STATE:-unknown}
image: modgate:local
init: true
read_only: true
cap_drop:
- ALL
security_opt:
- no-new-privileges:true
tmpfs:
- /tmp:rw,noexec,nosuid,size=64m
env_file:
- ${MODGATE_COMPOSE_ENV_FILE:-.env}
environment:
MODGATE_BIND: 0.0.0.0:38082
MODGATE_ENV_FILE: /config/.env
MODGATE_STATE_DIR: /data
MODGATE_CONTROL_STORE: /data/control-plane.json
MODGATE_CONFIG: /config/config.toml
MODGATE_DATABASE_URL: ${MODGATE_DATABASE_URL:-postgres://${MODGATE_POSTGRES_USER:-modgate}:${MODGATE_POSTGRES_PASSWORD:?set MODGATE_POSTGRES_PASSWORD in .env}@postgres:5432/${MODGATE_POSTGRES_DB:-modgate}}
MODGATE_TRUSTED_PROXIES: ${MODGATE_TRUSTED_PROXIES:-127.0.0.1,::1,172.16.0.0/12}
MODGATE_ALLOWED_ORIGINS: ${MODGATE_ALLOWED_ORIGINS:-}
RUST_LOG: ${RUST_LOG:-model_port=info,tower_http=info}
extra_hosts:
- "host.docker.internal:host-gateway"
ports:
- "${MODGATE_API_PUBLISH:-127.0.0.1:38082}:38082"
volumes:
- modgate-data:/data
- type: bind
source: ${MODGATE_COMPOSE_ENV_FILE:-./.env}
target: /config/.env
read_only: true
# Optional file-based provider config:
- ./config.toml:/config/config.toml:ro
depends_on:
postgres:
condition: service_healthy
restart: unless-stopped
logging:
driver: json-file
options:
max-size: ${MODGATE_LOG_MAX_SIZE:-10m}
max-file: "${MODGATE_LOG_MAX_FILES:-5}"
dashboard:
build:
context: .
dockerfile: dashboard/Dockerfile
image: modgate-dashboard:local
init: true
read_only: true
cap_drop:
- ALL
security_opt:
- no-new-privileges:true
tmpfs:
- /tmp:rw,noexec,nosuid,size=32m
depends_on:
modgate:
condition: service_healthy
ports:
- "${MODGATE_DASHBOARD_PUBLISH:-127.0.0.1:33002}:8080"
restart: unless-stopped
logging:
driver: json-file
options:
max-size: ${MODGATE_LOG_MAX_SIZE:-10m}
max-file: "${MODGATE_LOG_MAX_FILES:-5}"
volumes:
modgate-data:
modgate-postgres:
networks:
default:
name: ${MODGATE_NETWORK_NAME:-modgate_default}