mirror of
https://github.com/sablierapp/sablier.git
synced 2025-12-24 06:28:21 +01:00
As the Dockerfile is using an Alpine image for the final layer, it should try to respect Alpine and Linux FHS as much as possible. Note that the config file will remain in /etc/sablier/ folder Fixes #348
30 lines
833 B
Docker
30 lines
833 B
Docker
FROM golang:1.22 AS build
|
|
|
|
WORKDIR /src
|
|
RUN go env -w GOMODCACHE=/root/.cache/go-build
|
|
|
|
# See https://docs.docker.com/build/guide/mounts/#add-bind-mounts for cached builds
|
|
RUN --mount=type=cache,target=/root/.cache/go-build \
|
|
--mount=type=bind,source=go.sum,target=go.sum \
|
|
--mount=type=bind,source=go.mod,target=go.mod \
|
|
go mod download
|
|
|
|
COPY . /src
|
|
ARG BUILDTIME
|
|
ARG VERSION
|
|
ARG REVISION
|
|
ARG TARGETOS
|
|
ARG TARGETARCH
|
|
RUN --mount=type=cache,target=/root/.cache/go-build \
|
|
make BUILDTIME=${BUILDTIME} VERSION=${VERSION} GIT_REVISION=${REVISION} ${TARGETOS}/${TARGETARCH}
|
|
|
|
FROM alpine:3.20.1
|
|
|
|
RUN mkdir -p /etc/sablier/themes
|
|
EXPOSE 10000
|
|
|
|
COPY --from=build /src/sablier* /bin/sablier
|
|
COPY docker/sablier.yaml /etc/sablier/sablier.yaml
|
|
|
|
ENTRYPOINT [ "sablier" ]
|
|
CMD [ "--configFile=/etc/sablier/sablier.yaml", "start" ] |