Files
Gogs/Dockerfile
ᴊᴏᴇ ᴄʜᴇɴ 3b01892d85 fix(docker): correct binary path in Dockerfiles(#8125)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 13:02:25 -05:00

45 lines
915 B
Docker

FROM golang:alpine3.21 AS binarybuilder
RUN apk --no-cache --no-progress add --virtual \
build-deps \
build-base \
git \
linux-pam-dev
WORKDIR /gogs.io/gogs
COPY . .
RUN ./docker/build/install-task.sh
RUN TAGS="cert pam" task build
FROM alpine:3.21
RUN apk --no-cache --no-progress add \
bash \
ca-certificates \
curl \
git \
linux-pam \
openssh \
s6 \
shadow \
socat \
tzdata \
rsync
ENV GOGS_CUSTOM=/data/gogs
# Configure LibC Name Service
COPY docker/nsswitch.conf /etc/nsswitch.conf
WORKDIR /app/gogs
COPY docker ./docker
COPY --from=binarybuilder /gogs.io/gogs/.bin/gogs .
RUN ./docker/build/finalize.sh
# Configure Docker Container
VOLUME ["/data", "/backup"]
EXPOSE 22 3000
HEALTHCHECK CMD (curl --noproxy localhost -o /dev/null -sS http://localhost:3000/healthcheck) || exit 1
ENTRYPOINT ["/app/gogs/docker/start.sh"]
CMD ["/usr/bin/s6-svscan", "/app/gogs/docker/s6/"]