fix(backend): solve 500 errors with auto-migrations and standardized filenames

This commit is contained in:
Michael committed 2026-02-04 16:32:28 +01:00
1 parent 8ed1782de6
commit 502b76c5d6
6 files changed
+83 -36

No files matched your search

+19 -20
View File
@@ -1,34 +1,33 @@
# Build stage
FROM golang:1.22-alpine AS builder
# Multi-stage Dockerfile for FlowReader
# Step 1: Build the React Frontend
FROM node:20-alpine AS web-builder
WORKDIR /app/web
COPY web/package*.json ./
RUN npm install
COPY web/ ./
RUN npm run build
# Step 2: Build the Go Backend
FROM golang:1.24-alpine AS builder
WORKDIR /app
# Install dependencies
RUN apk add --no-cache git
# Copy go mod files
COPY go.mod go.sum* ./
COPY go.mod go.sum ./
RUN go mod download
# Copy source code
COPY . .
# Build the application
# Copy the built frontend from Step 1
COPY --from=web-builder /app/web/dist ./web/dist
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-w -s" -o /server ./cmd/server
# Final stage
# Step 3: Final Production Image
FROM alpine:3.19
WORKDIR /app
# Install wget for healthcheck
RUN apk add --no-cache wget ca-certificates
# Copy binary from builder
COPY --from=builder /server /app/server
# Copy the static files for the Go server to serve
COPY --from=builder /app/web/dist /app/web/dist
# Copy migration files for auto-migration
COPY --from=builder /app/migrations /app/migrations
# Expose port
EXPOSE 8080
# Run the application
CMD ["/app/server"]