Openstatus
www.openstatus.dev
1# syntax=docker/dockerfile:1.11
2# This file is generated by Dofigen v2.5.1
3# See https://github.com/lenra-io/dofigen
4
5# builder
6FROM golang@sha256:d3f0cf7723f3429e3f9ed846243970b20a2de7bae6a5b66fc5914e228d831bbb AS builder
7ARG TARGETARCH
8ARG TARGETOS
9LABEL \
10 org.opencontainers.image.base.digest="sha256:d3f0cf7723f3429e3f9ed846243970b20a2de7bae6a5b66fc5914e228d831bbb" \
11 org.opencontainers.image.base.name="docker.io/golang:1.25-alpine" \
12 org.opencontainers.image.stage="builder"
13ENV \
14 CGO_ENABLED="0" \
15 TZ="UTC"
16WORKDIR /go/src/app
17COPY \
18 --link \
19 "." "."
20RUN <<EOF
21apk add --no-cache tzdata
22go mod download
23GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -trimpath -ldflags "-s -w" -o private-location ./cmd/server
24EOF
25
26# runtime
27FROM alpine@sha256:5405e8f36ce1878720f71217d664aa3dea32e5e5df11acbf07fc78ef5661465b AS runtime
28LABEL \
29 io.dofigen.version="2.5.1" \
30 org.opencontainers.image.authors="OpenStatus Team" \
31 org.opencontainers.image.base.digest="sha256:5405e8f36ce1878720f71217d664aa3dea32e5e5df11acbf07fc78ef5661465b" \
32 org.opencontainers.image.base.name="docker.io/alpine:3.21" \
33 org.opencontainers.image.description="Private location orchestrator for OpenStatus" \
34 org.opencontainers.image.source="https://github.com/openstatusHQ/openstatus" \
35 org.opencontainers.image.title="OpenStatus Private Location" \
36 org.opencontainers.image.vendor="OpenStatus"
37ENV \
38 GIN_MODE="release" \
39 TZ="UTC" \
40 USER="1000"
41WORKDIR /opt/bin
42COPY \
43 --from=builder \
44 --chown=1000:1000 \
45 --link \
46 "/etc/ssl/certs/ca-certificates.crt" "/etc/ssl/certs/"
47COPY \
48 --from=builder \
49 --chown=1000:1000 \
50 --link \
51 "/usr/share/zoneinfo" "/usr/share/zoneinfo"
52COPY \
53 --from=builder \
54 --chown=1000:1000 \
55 --link \
56 "/go/src/app/private-location" "/opt/bin/private-location"
57USER 1000:1000
58EXPOSE 8080
59HEALTHCHECK \
60 --interval=15s \
61 --timeout=10s \
62 --start-period=30s \
63 --retries=3 \
64 CMD wget --spider -q http://localhost:8080/health || exit 1
65CMD ["/opt/bin/private-location"]