ots/Dockerfile
2025-12-19 12:50:09 +01:00

47 lines
1.2 KiB
Docker

FROM golang:1.25.5-alpine@sha256:ac09a5f469f307e5da71e766b0bd59c9c49ea460a528cc3e6686513d64a6f1fb AS builder
ENV CGO_ENABLED=0 \
GOPATH=/go \
NODE_ENV=production
COPY . /go/src/github.com/Luzifer/ots
WORKDIR /go/src/github.com/Luzifer/ots
RUN set -ex \
&& apk --no-cache add \
curl \
git \
make \
nodejs-current \
npm \
tar \
unzip \
&& make frontend_prod generate-apidocs \
&& go install \
-ldflags "-X main.version=$(git describe --tags --always || echo dev)" \
-mod=readonly
FROM alpine:3.23@sha256:865b95f46d98cf867a156fe4a135ad3fe50d2056aa3f25ed31662dff6da4eb62
LABEL org.opencontainers.image.authors='Knut Ahlers <knut@ahlers.me>' \
org.opencontainers.image.version='1.20.1' \
org.opencontainers.image.url='https://github.com/Luzifer/ots/pkgs/container/ots' \
org.opencontainers.image.documentation='https://github.com/Luzifer/ots/wiki' \
org.opencontainers.image.source='https://github.com/Luzifer/ots' \
org.opencontainers.image.licenses='Apache-2.0'
RUN set -ex \
&& apk --no-cache add \
ca-certificates
COPY --from=builder /go/bin/ots /usr/local/bin/ots
EXPOSE 3000
USER 1000:1000
ENTRYPOINT ["/usr/local/bin/ots"]
CMD ["--"]
# vim: set ft=Dockerfile: