|
|
@@ -1,4 +1,4 @@
|
|
|
-FROM golang:alpine3.22 AS binarybuilder
|
|
|
+FROM golang:alpine3.23 AS binarybuilder
|
|
|
RUN apk --no-cache --no-progress add --virtual \
|
|
|
build-deps \
|
|
|
build-base \
|
|
|
@@ -11,7 +11,7 @@ COPY . .
|
|
|
RUN ./docker/build/install-task.sh
|
|
|
RUN TAGS="cert pam" task build
|
|
|
|
|
|
-FROM alpine:3.22
|
|
|
+FROM alpine:3.23
|
|
|
|
|
|
# Create git user and group with fixed UID/GID at build time for better K8s security context support.
|
|
|
# Using 1000:1000 as it's a common non-root UID/GID that works well with most volume permission setups.
|
|
|
@@ -32,10 +32,11 @@ ENV GOGS_CUSTOM=/data/gogs
|
|
|
|
|
|
WORKDIR /app/gogs
|
|
|
COPY --from=binarybuilder /gogs.io/gogs/gogs .
|
|
|
-
|
|
|
-# Create data directories and set ownership
|
|
|
-RUN mkdir -p /data/gogs /data/git /backup && \
|
|
|
- chown -R git:git /app/gogs /data /backup
|
|
|
+COPY docker-next/start.sh .
|
|
|
+RUN chmod +x start.sh && \
|
|
|
+ mkdir -p /data && \
|
|
|
+ ln -s /data/git /home/git && \
|
|
|
+ chown -R git:git /app/gogs /data
|
|
|
|
|
|
# Configure Docker Container
|
|
|
VOLUME ["/data", "/backup"]
|
|
|
@@ -45,5 +46,5 @@ HEALTHCHECK CMD (curl -o /dev/null -sS http://localhost:3000/healthcheck) || exi
|
|
|
# Run as non-root user by default for better K8s security context support.
|
|
|
USER git:git
|
|
|
|
|
|
-ENTRYPOINT ["/app/gogs/gogs"]
|
|
|
-CMD ["web"]
|
|
|
+ENTRYPOINT ["/app/gogs/start.sh"]
|
|
|
+CMD ["/app/gogs/gogs", "web"]
|