diff --git a/webapp/golang/Dockerfile b/webapp/golang/Dockerfile index b810c3d7a..398b8dd05 100644 --- a/webapp/golang/Dockerfile +++ b/webapp/golang/Dockerfile @@ -21,16 +21,12 @@ RUN --mount=type=cache,target=/go/pkg/mod/ \ CGO_ENABLED=0 GOARCH=$TARGETARCH go build -o /bin/server . ################################################################################ -FROM alpine:3.20 AS final +FROM debian:bookworm-slim AS final -# Install any runtime dependencies that are needed to run your application. -# Leverage a cache mount to /var/cache/apk/ to speed up subsequent builds. -RUN --mount=type=cache,target=/var/cache/apk \ - apk --update add \ - ca-certificates \ - tzdata \ - && \ - update-ca-certificates +RUN \ + --mount=type=cache,target=/var/lib/apt,sharing=locked \ + --mount=type=cache,target=/var/cache/apt,sharing=locked \ + apt-get update -qq && apt-get install -y openssl # Create a non-privileged user that the app will run under. # See https://docs.docker.com/go/dockerfile-user-best-practices/ @@ -45,8 +41,11 @@ RUN adduser \ appuser USER appuser +WORKDIR /home/webapp + # Copy the executable from the "build" stage. COPY --from=build /bin/server /bin/ +COPY ./templates ./templates # What the container should run when it is started. ENTRYPOINT [ "/bin/server" ]