mirror of
https://github.com/Dvorinka/Bookra.git
synced 2026-06-03 20:13:00 +00:00
cleanup
This commit is contained in:
@@ -16,20 +16,23 @@ COPY . .
|
||||
# Build the application
|
||||
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-w -s" -o /app/auth-service ./cmd/api
|
||||
|
||||
# Final stage
|
||||
FROM alpine:3.22
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Install ca-certificates for HTTPS
|
||||
RUN apk add --no-cache ca-certificates
|
||||
RUN apk add --no-cache ca-certificates \
|
||||
&& addgroup -S bookra \
|
||||
&& adduser -S -D -H -u 10001 -G bookra bookra
|
||||
|
||||
# Copy binary from builder
|
||||
COPY --from=builder /app/auth-service /app/
|
||||
|
||||
# Copy migrations
|
||||
COPY --from=builder /app/migrations /app/migrations
|
||||
COPY --from=builder --chown=bookra:bookra /app/auth-service /app/
|
||||
COPY --from=builder --chown=bookra:bookra /app/migrations /app/migrations
|
||||
|
||||
ENV PORT=8080
|
||||
EXPOSE 8080
|
||||
|
||||
USER bookra
|
||||
|
||||
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
|
||||
CMD wget -qO- "http://127.0.0.1:${PORT:-8080}/health" >/dev/null || exit 1
|
||||
|
||||
CMD ["/app/auth-service"]
|
||||
|
||||
Reference in New Issue
Block a user