2023-01-30 20:38:53 +08:00
|
|
|
FROM golang:alpine3.17 AS binarybuilder
|
2019-11-25 22:49:25 -08:00
|
|
|
RUN apk --no-cache --no-progress add --virtual \
|
|
|
|
|
build-deps \
|
|
|
|
|
build-base \
|
|
|
|
|
git \
|
|
|
|
|
linux-pam-dev
|
|
|
|
|
|
2020-04-07 16:00:12 +08:00
|
|
|
WORKDIR /gogs.io/gogs
|
2018-08-13 20:50:25 +08:00
|
|
|
COPY . .
|
2022-05-29 19:45:25 +08:00
|
|
|
|
|
|
|
|
RUN ./docker/build/install-task.sh
|
|
|
|
|
RUN TAGS="cert pam" task build
|
2015-08-25 12:41:01 +08:00
|
|
|
|
2023-01-30 20:38:53 +08:00
|
|
|
FROM alpine:3.17
|
2022-05-29 19:45:25 +08:00
|
|
|
RUN apk --no-cache --no-progress add \
|
2019-11-25 22:49:25 -08:00
|
|
|
bash \
|
|
|
|
|
ca-certificates \
|
|
|
|
|
curl \
|
|
|
|
|
git \
|
|
|
|
|
linux-pam \
|
|
|
|
|
openssh \
|
|
|
|
|
s6 \
|
|
|
|
|
shadow \
|
|
|
|
|
socat \
|
|
|
|
|
tzdata \
|
|
|
|
|
rsync
|
2015-08-25 12:41:01 +08:00
|
|
|
|
2015-10-02 21:18:13 +02:00
|
|
|
ENV GOGS_CUSTOM /data/gogs
|
2015-08-25 12:41:01 +08:00
|
|
|
|
2020-08-23 14:39:14 +08:00
|
|
|
# Configure LibC Name Service
|
2017-10-13 21:26:39 +01:00
|
|
|
COPY docker/nsswitch.conf /etc/nsswitch.conf
|
|
|
|
|
|
2018-08-13 20:50:25 +08:00
|
|
|
WORKDIR /app/gogs
|
|
|
|
|
COPY docker ./docker
|
2020-04-07 16:00:12 +08:00
|
|
|
COPY --from=binarybuilder /gogs.io/gogs/gogs .
|
2017-02-19 02:43:27 +01:00
|
|
|
|
2022-05-29 19:45:25 +08:00
|
|
|
RUN ./docker/build/finalize.sh
|
2015-08-17 03:10:23 -04:00
|
|
|
|
2020-08-23 14:39:14 +08:00
|
|
|
# Configure Docker Container
|
2020-05-11 05:55:21 +02:00
|
|
|
VOLUME ["/data", "/backup"]
|
2015-08-17 03:10:23 -04:00
|
|
|
EXPOSE 22 3000
|
2022-01-20 16:11:35 +08:00
|
|
|
HEALTHCHECK CMD (curl -o /dev/null -sS http://localhost:3000/healthcheck) || exit 1
|
2017-02-19 02:43:27 +01:00
|
|
|
ENTRYPOINT ["/app/gogs/docker/start.sh"]
|
2015-11-16 16:48:09 +00:00
|
|
|
CMD ["/bin/s6-svscan", "/app/gogs/docker/s6/"]
|