Go backend with domain-based packages (volunteer, schedule, timeoff, checkin, notification), SQLite storage, JWT auth, and chi router. React TypeScript frontend with routing, auth context, and pages for all core features. Multi-stage Dockerfile and docker-compose included. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
26 lines
585 B
Docker
26 lines
585 B
Docker
# Stage 1: Build React frontend
|
|
FROM node:22-alpine AS frontend
|
|
WORKDIR /app/web
|
|
COPY web/package*.json ./
|
|
RUN npm ci
|
|
COPY web/ ./
|
|
RUN npm run build
|
|
|
|
# Stage 2: Build Go backend
|
|
FROM golang:1.26-alpine AS backend
|
|
WORKDIR /app
|
|
COPY go.mod go.sum ./
|
|
RUN go mod download
|
|
COPY . .
|
|
RUN CGO_ENABLED=0 GOOS=linux go build -o /walkies ./cmd/server
|
|
|
|
# Stage 3: Final image
|
|
FROM alpine:3.21
|
|
RUN apk add --no-cache ca-certificates tzdata
|
|
WORKDIR /app
|
|
COPY --from=backend /walkies ./walkies
|
|
COPY --from=frontend /app/web/build ./web/dist
|
|
EXPOSE 8080
|
|
ENV STATIC_DIR=/app/web/dist
|
|
CMD ["./walkies"]
|