Files
class-server/Dockerfile
Ryan McGuire 5be3ae03d4
Some checks failed
Build and Publish / release (push) Has been skipped
Build and Publish / check-chart (push) Successful in 11s
Build and Publish / helm-release (push) Failing after 16s
move to class-server
2025-07-08 16:47:21 -04:00

28 lines
590 B
Docker

FROM golang:1-alpine AS build
WORKDIR /app
ENV GO111MODULE=auto CGO_ENABLED=0 GOOS=linux
ARG GOPROXY
ARG GONOSUMDB=gitea.libretechconsulting.com
ARG VER_PKG=gitea.libretechconsulting.com/rmcguire/go-app/pkg/config.Version
ARG VERSION=(devel)
ARG APP_NAME=class-server
COPY ./go.mod ./go.sum ./
RUN go mod download
COPY ./ /app
RUN go build -C . -v -ldflags "-extldflags '-static' -X ${VER_PKG}=${VERSION}" -o ${APP_NAME} .
FROM alpine:latest
ARG APP_NAME=demo-app
WORKDIR /app
USER 100:101
COPY --from=build --chown=100:101 /app/${APP_NAME} /app/
ENTRYPOINT [ "/app/${APP_NAME}" ]