Initial release: Disc Agenda frisbee tournament platform
Some checks failed
Build and Push / build (push) Failing after 8s
Some checks failed
Build and Push / build (push) Failing after 8s
Full-stack tournament management app with real-time scoring: - Go 1.26 backend with REST API and WebSocket live scoring - React 19 + Vite 8 frontend with mobile-first design - File-based JSON storage with JSONL audit logs - Multi-stage Docker build with Gitea CI/CD pipeline - Post-tournament questionnaire with spirit voting - Technical documentation and project description Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
42
Dockerfile
Normal file
42
Dockerfile
Normal file
@@ -0,0 +1,42 @@
|
||||
# ---- Stage 1: Build frontend ----
|
||||
FROM node:22-alpine AS frontend-build
|
||||
WORKDIR /app/frontend
|
||||
COPY frontend/package.json frontend/package-lock.json ./
|
||||
RUN npm ci
|
||||
COPY frontend/ ./
|
||||
RUN npx vite build
|
||||
|
||||
# ---- Stage 2: Build Go backend ----
|
||||
FROM golang:1.26-alpine AS backend-build
|
||||
WORKDIR /app/backend
|
||||
COPY backend/go.mod backend/go.sum ./
|
||||
RUN go mod download
|
||||
COPY backend/ ./
|
||||
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o /server ./cmd/server
|
||||
|
||||
# ---- Stage 3: Runtime ----
|
||||
FROM alpine:3.21
|
||||
RUN apk add --no-cache ca-certificates tzdata
|
||||
WORKDIR /app
|
||||
|
||||
COPY --from=backend-build /server /app/server
|
||||
COPY --from=frontend-build /app/frontend/dist /app/static
|
||||
COPY data/ /app/data-seed/
|
||||
|
||||
EXPOSE 8080
|
||||
|
||||
ENV PORT=8080
|
||||
ENV DATA_DIR=/app/data
|
||||
|
||||
# Copy seed data on first run if /app/data is empty (volume mount)
|
||||
COPY <<'EOF' /app/entrypoint.sh
|
||||
#!/bin/sh
|
||||
if [ ! -f /app/data/tournaments.json ]; then
|
||||
echo "Seeding initial data..."
|
||||
cp -r /app/data-seed/* /app/data/
|
||||
fi
|
||||
exec /app/server -static /app/static -data /app/data
|
||||
EOF
|
||||
RUN chmod +x /app/entrypoint.sh
|
||||
|
||||
ENTRYPOINT ["/app/entrypoint.sh"]
|
||||
Reference in New Issue
Block a user