tf-services/cloud-init.yaml
quinn 870bb55174 feat(tf-services): shared services droplet (3 Forgejo + Verdaccio) module
DO droplet (nyc3 s-2vcpu-4gb + swap) running 3 co-located Forgejo (ct/mc/quinn)
+ Verdaccio via docker-compose. HTTP+token (built-in SSH disabled). Provisioned
165.227.191.38; state local (gitignored).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-29 18:20:43 -04:00

72 lines
2.4 KiB
YAML

#cloud-config
package_update: true
packages:
- docker.io
- docker-compose-v2
write_files:
- path: /opt/services/docker-compose.yml
permissions: "0644"
content: |
services:
forgejo-ct:
image: codeberg.org/forgejo/forgejo:10
restart: always
environment:
USER_UID: "1000"
USER_GID: "1000"
FORGEJO__server__HTTP_PORT: "3000"
FORGEJO__server__SSH_PORT: "2222"
FORGEJO__security__INSTALL_LOCK: "true"
FORGEJO__service__DISABLE_REGISTRATION: "true"
volumes:
- /opt/services/ct:/data
ports:
- "3000:3000"
- "2222:22"
forgejo-mc:
image: codeberg.org/forgejo/forgejo:10
restart: always
environment:
USER_UID: "1000"
USER_GID: "1000"
FORGEJO__server__HTTP_PORT: "3000"
FORGEJO__server__SSH_PORT: "2223"
FORGEJO__security__INSTALL_LOCK: "true"
FORGEJO__service__DISABLE_REGISTRATION: "true"
volumes:
- /opt/services/mc:/data
ports:
- "3001:3000"
- "2223:22"
forgejo-quinn:
image: codeberg.org/forgejo/forgejo:10
restart: always
environment:
USER_UID: "1000"
USER_GID: "1000"
FORGEJO__server__HTTP_PORT: "3000"
FORGEJO__server__SSH_PORT: "2224"
FORGEJO__security__INSTALL_LOCK: "true"
FORGEJO__service__DISABLE_REGISTRATION: "true"
volumes:
- /opt/services/quinn:/data
ports:
- "3002:3000"
- "2224:22"
verdaccio:
image: verdaccio/verdaccio:6
restart: always
ports:
- "4873:4873"
volumes:
- /opt/services/verdaccio:/verdaccio/storage
runcmd:
# 2GB swap (safety on the 4GB box)
- [ bash, -c, "fallocate -l 2G /swapfile && chmod 600 /swapfile && mkswap /swapfile && swapon /swapfile && echo '/swapfile none swap sw 0 0' >> /etc/fstab" ]
- [ bash, -c, "mkdir -p /opt/services/ct /opt/services/mc /opt/services/quinn /opt/services/verdaccio && chown -R 1000:1000 /opt/services" ]
- [ systemctl, enable, --now, docker ]
- [ bash, -c, "cd /opt/services && docker compose up -d" ]
final_message: "services droplet up: 3 Forgejo (ct:3000 mc:3001 quinn:3002) + Verdaccio:4873"