Files
sablier/Dockerfile
Alexis Couvreur 82ae5e905a fix(docker): move sablier binary from /etc/sablier/sablier to /bin/sablier
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
2024-10-01 17:30:14 -07:00

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" ]