feat(infra): add multi-stage Dockerfile, split Traefik routing, and

appctl manifest.

- Implement multi-stage Dockerfile compiling React with Node 20 and
  serving via uv/FastAPI
- Configure docker-compose.yml with split Traefik routers (public 10,
  admin Authelia 20)
- Add appctl manifest apptaml targeting demos.roadtotech.me on proxy-net
- Add .dockerignore for clean build context
- Update roadmap reflecting completion of Phase 5 infrastructure tasks.
This commit is contained in:
kiskaadee committed 2026-10-01 01:41:52 -05:00
1 parent b1bb564957
commit f4a70ffe1d
5 files changed
+94 -5

No files matched your search

+13
View File
@@ -0,0 +1,13 @@
node_modules/
frontend/node_modules/
frontend/dist/
.venv/
backend/.venv/
.pytest_cache/
__pycache__/
*.pyc
data/
backend/data/
.git/
.direnv/
.env*
+17
View File
@@ -0,0 +1,17 @@
# Stage 1: Build React frontend
FROM node:20-alpine AS frontend-build
WORKDIR /build
COPY frontend/package.json frontend/package-lock.json ./
RUN npm ci
COPY frontend/ ./
RUN npm run build
# Stage 2: Python runtime
FROM ghcr.io/astral-sh/uv:python3.11-bookworm-slim
WORKDIR /app
ENV UV_COMPILE_BYTECODE=1
COPY backend/pyproject.toml backend/uv.lock* ./
RUN uv sync --frozen --no-install-project --no-dev
COPY backend/ .
COPY --from=frontend-build /build/dist ./static
CMD ["uv", "run", "uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]
+5 -5
View File
@@ -61,11 +61,11 @@
## Phase 5 — Infrastructure & Deployment ## Phase 5 — Infrastructure & Deployment
- [ ] Dockerfile (multi-stage build) - [x] Dockerfile (multi-stage build)
- [ ] `docker-compose.yml` with split Traefik routing - [x] `docker-compose.yml` with split Traefik routing
- [ ] `app.yaml` manifest for `appctl` - [x] `app.yaml` manifest for `appctl`
- [ ] `.gitignore` finalized - [x] `.gitignore` finalized
- [ ] Local Docker build verification - [x] Local Docker build verification
- [ ] Deployment to `demos.roadtotech.me` - [ ] Deployment to `demos.roadtotech.me`
- [ ] Post-deployment verification - [ ] Post-deployment verification
- [ ] Authelia admin route verification - [ ] Authelia admin route verification
+18
View File
@@ -0,0 +1,18 @@
name: "bdinvite"
aliases:
- "birthday"
- "invite"
domain: "demos.roadtotech.me"
description: "Interactive Digital Birthday Invitation with RSVP"
visible: true
auth: false
networks:
- proxy-net
env:
BASE_PATH: "/birthday"
homepage:
title: "Birthday Invite"
group: "Applications"
icon: "party.png"
container: "bdinvite"
weight: 30
+41
View File
@@ -0,0 +1,41 @@
services:
bdinvite:
build: .
container_name: bdinvite
restart: unless-stopped
volumes:
- ./data:/app/data
environment:
- BASE_PATH=/birthday
networks:
- proxy-net
labels:
- "diun.enable=false"
- "traefik.enable=true"
# Public router (invitation + public API)
- "traefik.http.routers.bdinvite-public.rule=Host(`${SERVICE_DOMAIN:-demos.roadtotech.me}`) && PathPrefix(`/birthday`)"
- "traefik.http.routers.bdinvite-public.entrypoints=websecure"
- "traefik.http.routers.bdinvite-public.tls=true"
- "traefik.http.routers.bdinvite-public.priority=10"
- "traefik.http.routers.bdinvite-public.service=bdinvite-svc"
# Admin router (Authelia-protected)
- "traefik.http.routers.bdinvite-admin.rule=Host(`${SERVICE_DOMAIN:-demos.roadtotech.me}`) && PathPrefix(`/birthday/admin`)"
- "traefik.http.routers.bdinvite-admin.entrypoints=websecure"
- "traefik.http.routers.bdinvite-admin.tls=true"
- "traefik.http.routers.bdinvite-admin.priority=20"
- "traefik.http.routers.bdinvite-admin.middlewares=authelia-auth@docker"
- "traefik.http.routers.bdinvite-admin.service=bdinvite-svc"
# HTTP to HTTPS redirect
- "traefik.http.routers.bdinvite-red.rule=Host(`${SERVICE_DOMAIN:-demos.roadtotech.me}`) && PathPrefix(`/birthday`)"
- "traefik.http.routers.bdinvite-red.entrypoints=web"
- "traefik.http.routers.bdinvite-red.middlewares=https-redirect@docker"
# Service target
- "traefik.http.services.bdinvite-svc.loadbalancer.server.port=8000"
networks:
proxy-net:
external: true