mirror of
https://github.com/lukaszraczylo/gohoarder.git
synced 2026-11-25 06:35:21 +00:00
Docker Hub rate-limited the v0.1.328 release build, so goreleaser kept retrying the base image pulls. The Dockerfiles now pull alpine 3.24.4 and nginx 1.31.9-alpine from mirror.gcr.io, pinned by digest. Those digests are what alpine:latest and nginx:alpine resolved to, so the images are unchanged, and a release no longer moves silently with a floating tag.
55 lines
1.7 KiB
Docker
55 lines
1.7 KiB
Docker
# Application Engine - Main GoHoarder Server
|
|
# This Dockerfile expects a PRE-BUILT binary from GoReleaser (no compilation)
|
|
# GoReleaser injects the platform-specific binary automatically
|
|
|
|
FROM --platform=$TARGETPLATFORM mirror.gcr.io/library/alpine:3.24.4@sha256:f59abe656b692d901e184be3445e084786602108599d2a51d229c0f5a48c71bf
|
|
|
|
ARG TARGETARCH
|
|
|
|
# Install runtime dependencies (CGO/SQLite requires these)
|
|
RUN apk add --no-cache \
|
|
ca-certificates \
|
|
tzdata \
|
|
sqlite-libs \
|
|
musl \
|
|
&& update-ca-certificates
|
|
|
|
# Create non-root user
|
|
RUN addgroup -g 1000 gohoarder && \
|
|
adduser -D -u 1000 -G gohoarder gohoarder
|
|
|
|
# Create necessary directories with proper permissions
|
|
RUN mkdir -p /var/cache/gohoarder \
|
|
/var/lib/gohoarder/metadata \
|
|
/tmp/gohoarder && \
|
|
chown -R gohoarder:gohoarder /var/cache/gohoarder \
|
|
/var/lib/gohoarder \
|
|
/tmp/gohoarder && \
|
|
chmod -R 750 /var/cache/gohoarder \
|
|
/var/lib/gohoarder
|
|
|
|
# Copy pre-built binary from GoReleaser
|
|
# GoReleaser will automatically inject the correct binary for the target platform
|
|
# In split/merge mode, binaries are in linux/${TARGETARCH}/ subdirectories
|
|
COPY linux/${TARGETARCH}/gohoarder /usr/local/bin/gohoarder
|
|
RUN chmod +x /usr/local/bin/gohoarder
|
|
|
|
# Copy example config
|
|
COPY config.yaml.example /etc/gohoarder/config.yaml.example
|
|
|
|
WORKDIR /var/cache/gohoarder
|
|
USER gohoarder
|
|
|
|
# Expose ports
|
|
# 8080: Main proxy port
|
|
# 9090: Metrics/health port
|
|
EXPOSE 8080 9090
|
|
|
|
# Health check
|
|
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
|
|
CMD ["/usr/local/bin/gohoarder", "version"] || exit 1
|
|
|
|
# Run the server
|
|
ENTRYPOINT ["/usr/local/bin/gohoarder"]
|
|
CMD ["serve"]
|