splatoon/Dockerfile
Ash b9d3bd3482
Some checks failed
Build and Publish Docker Image / build-publish (push) Has been cancelled
Updates to underlying libraries (#16)
* chore: update grpc bits and add local auth mode

* chore: library updates and token validation

* fix: small things

* feat: use secret unreleased protocols

* chore: update go modules

* chore: bump golang version
2025-10-20 00:31:02 +11:00

36 lines
712 B
Docker

# syntax=docker/dockerfile:1
ARG app_dir="/home/go/app"
# * Building the application
FROM golang:1.25-alpine3.22 AS build
ARG app_dir
WORKDIR ${app_dir}
RUN --mount=type=cache,target=/go/pkg/mod/ \
--mount=type=bind,source=go.sum,target=go.sum \
--mount=type=bind,source=go.mod,target=go.mod \
go mod download -x
COPY . .
RUN --mount=type=cache,target=/go/pkg/mod/ \
CGO_ENABLED=0 go build -v -o ${app_dir}/build/server
# * Running the final application
FROM alpine:3.22 AS final
ARG app_dir
WORKDIR ${app_dir}
RUN addgroup go && adduser -D -G go go
RUN mkdir -p ${app_dir}/log && chown go:go ${app_dir}/log
USER go
COPY --from=build ${app_dir}/build/server ${app_dir}/server
CMD [ "./server" ]