mirror of
https://github.com/Dvorinka/MyClubServer.git
synced 2026-06-04 02:32:57 +00:00
dev day #79
This commit is contained in:
+15
-1
@@ -21,15 +21,29 @@ FROM alpine:latest
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Install runtime dependencies (TLS certs, timezone data) and create non-root user
|
||||
RUN apk add --no-cache ca-certificates tzdata \
|
||||
&& addgroup -S app && adduser -S app -G app \
|
||||
&& mkdir -p /app/uploads /app/cache \
|
||||
&& chown -R app:app /app
|
||||
|
||||
# Copy the binary from builder
|
||||
COPY --from=builder /app/fotbal-club .
|
||||
COPY --from=builder /app/fotbal-club ./fotbal-club
|
||||
|
||||
# Copy templates and static files if any
|
||||
COPY ./templates ./templates
|
||||
COPY ./static ./static
|
||||
|
||||
# Environment and permissions
|
||||
ENV GIN_MODE=release
|
||||
USER app
|
||||
|
||||
# Expose port
|
||||
EXPOSE 8080
|
||||
|
||||
# Healthcheck: use busybox wget to probe liveness/readiness
|
||||
HEALTHCHECK --interval=30s --timeout=5s --start-period=30s --retries=3 \
|
||||
CMD wget -q -O - http://127.0.0.1:8080/api/v1/health >/dev/null 2>&1 || exit 1
|
||||
|
||||
# Command to run the executable
|
||||
CMD ["./fotbal-club"]
|
||||
|
||||
Reference in New Issue
Block a user