-
-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
68 lines (64 loc) · 2.47 KB
/
Copy pathdocker-compose.yml
File metadata and controls
68 lines (64 loc) · 2.47 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
# Gitcord - Docker Compose for mentor-friendly deployment.
# Usage: copy .env and config, then run: docker compose up -d
# Data (SQLite, reports, identity links) persists in named volume gitcord_data.
# init_data ensures /data is owned by appuser (image runs as non-root); runs once then exits.
#
# Optional scheduled sync (every 6h by default):
# docker compose --profile scheduler up -d
# Or use host cron: deploy/cron/gitcord-sync.crontab + scripts/scheduled-run-once.sh
services:
init_data:
build: .
image: gitcord:latest
user: "0"
entrypoint: []
volumes:
- gitcord_data:/data
command: ["sh", "-c", "chown -R appuser:appuser /data"]
bot:
build: .
image: gitcord:latest
env_file: .env
depends_on:
init_data:
condition: service_completed_successfully
# Host networking: Docker bridge DNS on this campus network is flaky
# (gateway disconnect → slash commands show "The application did not respond").
network_mode: host
volumes:
# Mount config so you can edit YAML without rebuilding (use data_dir: /data in config).
- ./config:/app/config:ro
# Persist SQLite state, reports, and audit logs between restarts.
- gitcord_data:/data
# GitHub App private key (set GITCORD_PEM_HOST in .env — required).
- ${GITCORD_PEM_HOST:?Set GITCORD_PEM_HOST to the host path of the GitHub App PEM}:/secrets/gitcordapp.pem:ro
command: ["--config", "/app/config/config.yaml", "bot"]
restart: unless-stopped
# Optional: periodic run-once in the same image/volume as the bot (no host cron).
# Enable: docker compose --profile scheduler up -d
sync-scheduler:
build: .
image: gitcord:latest
env_file: .env
profiles:
- scheduler
depends_on:
init_data:
condition: service_completed_successfully
# Host networking: Docker bridge DNS on this campus network is flaky
# (Temporary failure in name resolution → empty syncs). Host DNS works.
network_mode: host
volumes:
- ./config:/app/config:ro
- ./scripts:/app/scripts:ro
- gitcord_data:/data
- ${GITCORD_PEM_HOST:?Set GITCORD_PEM_HOST to the host path of the GitHub App PEM}:/secrets/gitcordapp.pem:ro
environment:
GITCORD_CONFIG: /app/config/config.yaml
GITCORD_SYNC_INTERVAL_SECONDS: ${GITCORD_SYNC_INTERVAL_SECONDS:-21600}
entrypoint: []
user: appuser
command: ["bash", "/app/scripts/sync-loop.sh"]
restart: unless-stopped
volumes:
gitcord_data: