Add infrastructure: Terraform, Docker Compose, BRouter, CD pipeline (#2)
Terraform: - Hetzner CX22 server with Docker, firewall (80/443/22) - SSH key and output for server IP Docker Compose: - Caddy reverse proxy (auto HTTPS) - Journal and Planner app containers - BRouter routing engine container - PostgreSQL + PostGIS - Garage S3 storage BRouter: - Dockerfile based on eclipse-temurin:11-jre - Segment download script for Germany (4 tiles, ~750MB) CD Pipeline: - Build & push Docker images to ghcr.io on main push - Deploy step commented out (enable when server provisioned) Scripts: - PostgreSQL daily backup with 14-day retention - Dockerfiles for both apps (multi-stage builds) Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
464ba0f64d
commit
7908a518b1
13 changed files with 429 additions and 7 deletions
78
.github/workflows/cd.yml
vendored
Normal file
78
.github/workflows/cd.yml
vendored
Normal file
|
|
@ -0,0 +1,78 @@
|
|||
name: CD
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
|
||||
concurrency:
|
||||
group: deploy
|
||||
cancel-in-progress: false
|
||||
|
||||
jobs:
|
||||
build-images:
|
||||
name: Build & Push Docker Images
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
strategy:
|
||||
matrix:
|
||||
app: [journal, planner]
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
|
||||
- uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
file: apps/${{ matrix.app }}/Dockerfile
|
||||
push: true
|
||||
tags: |
|
||||
ghcr.io/trails-cool/${{ matrix.app }}:latest
|
||||
ghcr.io/trails-cool/${{ matrix.app }}:${{ github.sha }}
|
||||
|
||||
build-brouter:
|
||||
name: Build & Push BRouter Image
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
|
||||
- uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: docker/brouter
|
||||
push: true
|
||||
tags: |
|
||||
ghcr.io/trails-cool/brouter:latest
|
||||
ghcr.io/trails-cool/brouter:${{ github.sha }}
|
||||
|
||||
# Deploy step - uncomment when Hetzner server is provisioned
|
||||
# deploy:
|
||||
# name: Deploy to Hetzner
|
||||
# needs: [build-images, build-brouter]
|
||||
# runs-on: ubuntu-latest
|
||||
# steps:
|
||||
# - uses: actions/checkout@v6
|
||||
# - name: Deploy via SSH
|
||||
# uses: appleboy/ssh-action@v1
|
||||
# with:
|
||||
# host: ${{ secrets.DEPLOY_HOST }}
|
||||
# username: root
|
||||
# key: ${{ secrets.DEPLOY_SSH_KEY }}
|
||||
# script: |
|
||||
# cd /opt/trails-cool
|
||||
# docker compose pull
|
||||
# docker compose up -d
|
||||
Loading…
Add table
Add a link
Reference in a new issue