pr_01m47d24b0e6n91zwymwxg0vpx/deploy/self-host/docker-compose.yml

80 lines2,789 bytesCodeBlame
1# Self-hosted g1t, phase 1: the core forge on your own machine.
2#
3# docker compose -f deploy/self-host/docker-compose.yml up --build
4#
5# Then open http://localhost:8787. Mail (the confirmation link at sign-up)
6# lands in Mailpit at http://localhost:8025.
7#
8# What runs: the site and every core service in one workerd (g1t), git
9# repositories as bare repos on a volume (gitstore), and Mailpit for mail.
10# Agents, deployments, context search and billing are off. See
11# docs/SELF_HOSTING.md.
12name: g1t
13
14services:
15 g1t:
16 build:
17 context: ../..
18 dockerfile: deploy/self-host/Dockerfile
19 ports:
20 - "${G1T_PORT:-8787}:8787"
21 environment:
22 # Where people reach this installation. Links in mail point here.
23 PUBLIC_URL: ${PUBLIC_URL:-http://localhost:8787}
24 GITSTORE_URL: http://gitstore:8080
25 GITSTORE_SECRET_FILE: /secrets/gitstore
26 MAIL_URL: ${MAIL_URL:-http://mailpit:8025}
27 MAIL_FROM: ${MAIL_FROM:-g1t <noreply@localhost>}
28 # Your own GitHub App, for "Continue with GitHub" and importing from
29 # GitHub. Leave these unset to have neither. See the self-hosting guide.
30 GITHUB_APP_ID: ${GITHUB_APP_ID:-}
31 GITHUB_APP_SLUG: ${GITHUB_APP_SLUG:-}
32 GITHUB_APP_CLIENT_ID: ${GITHUB_APP_CLIENT_ID:-}
33 GITHUB_APP_CLIENT_SECRET: ${GITHUB_APP_CLIENT_SECRET:-}
34 GITHUB_APP_PRIVATE_KEY: ${GITHUB_APP_PRIVATE_KEY:-}
35 GITHUB_APP_WEBHOOK_SECRET: ${GITHUB_APP_WEBHOOK_SECRET:-}
36 # open: anyone may register. invite: a new account needs an invite
37 # code, as on g1t.sh; the owners of INVITE_STAFF_WORKSPACES (slugs,
38 # comma separated) invite without limit, everyone else INVITES_PER_USER.
39 REGISTRATION_MODE: ${REGISTRATION_MODE:-open}
40 INVITE_STAFF_WORKSPACES: ${INVITE_STAFF_WORKSPACES:-}
41 INVITES_PER_USER: ${INVITES_PER_USER:-}
42 volumes:
43 - g1t-data:/data
44 - g1t-secrets:/secrets:ro
45 depends_on:
46 gitstore:
47 condition: service_healthy
48 mailpit:
49 condition: service_started
50 restart: unless-stopped
51
52 gitstore:
53 build:
54 context: ./gitstore
55 environment:
56 GITSTORE_URL: http://gitstore:8080
57 GITSTORE_SECRET_FILE: /secrets/gitstore
58 volumes:
59 - g1t-git:/data/git
60 - g1t-secrets:/secrets
61 # Not published: only the g1t container reaches it.
62 restart: unless-stopped
63
64 mailpit:
65 image: axllent/mailpit:latest
66 ports:
67 - "${MAILPIT_PORT:-8025}:8025"
68 # To deliver for real, relay through your SMTP server:
69 # environment:
70 # MP_SMTP_RELAY_HOST: smtp.example.com
71 # MP_SMTP_RELAY_PORT: "587"
72 # MP_SMTP_RELAY_USERNAME: ...
73 # MP_SMTP_RELAY_PASSWORD: ...
74 # MP_SMTP_RELAY_ALL: "true"
75 restart: unless-stopped
76
77volumes:
78 g1t-data:
79 g1t-git:
80 g1t-secrets: