# Migration Engine - Database Migration Tool # This Dockerfile expects a PRE-BUILT binary from GoReleaser (no compilation) # GoReleaser injects the platform-specific binary automatically FROM alpine:latest # Install runtime dependencies (including CGO/SQLite dependencies) RUN apk add --no-cache \ ca-certificates \ postgresql-client \ mysql-client \ busybox-extras \ sqlite-libs \ musl \ && update-ca-certificates # Create non-root user RUN addgroup -g 1000 gohoarder && \ adduser -D -u 1000 -G gohoarder gohoarder # Copy pre-built binary from GoReleaser # GoReleaser will automatically inject the correct binary for the target platform COPY migrate /usr/local/bin/migrate RUN chmod +x /usr/local/bin/migrate # Copy migration SQL files COPY migrations /migrations WORKDIR /app USER gohoarder # Run migrations ENTRYPOINT ["/usr/local/bin/migrate"] CMD ["--action=migrate"]