Skip to content

Open-source status page, incident response and uptime monitoring

2.1 KB
Raw Blame
# syntax=docker/dockerfile:1.19.0
# This file is generated by Dofigen v2.8.0
# See https://github.com/lenra-io/dofigen

# builder
FROM golang@sha256:dc9ad6c05acc7a88e5b71bde60a5fe3bd4b9f0db209011711b464107438a8107 AS builder
LABEL \
    org.opencontainers.image.base.digest="sha256:dc9ad6c05acc7a88e5b71bde60a5fe3bd4b9f0db209011711b464107438a8107" \
    org.opencontainers.image.base.name="docker.io/golang:1.26-bookworm" \
    org.opencontainers.image.stage="builder"
ENV \
    TZ="UTC" \
    CGO_ENABLED="1"
WORKDIR /go/src/app
COPY \
    --link \
    "." "."
RUN <<EOF
go mod download
go build -trimpath -ldflags "-s -w" -o private-location ./cmd/server
EOF

# runtime
FROM debian@sha256:7c7b2c966bc9ee8cedfeef67e0e279108992c77681fa595db4a9d65c06ccc587 AS runtime
LABEL \
    io.dofigen.version="2.8.0" \
    org.opencontainers.image.authors="OpenStatus Team" \
    org.opencontainers.image.base.digest="sha256:7c7b2c966bc9ee8cedfeef67e0e279108992c77681fa595db4a9d65c06ccc587" \
    org.opencontainers.image.base.name="docker.io/debian:bookworm-slim" \
    org.opencontainers.image.description="Private location orchestrator for OpenStatus" \
    org.opencontainers.image.source="https://github.com/openstatusHQ/openstatus" \
    org.opencontainers.image.title="OpenStatus Private Location" \
    org.opencontainers.image.vendor="OpenStatus"
ENV \
    TZ="UTC" \
    USER="1000" \
    GIN_MODE="release"
WORKDIR /opt/bin
COPY \
    --from=builder \
    --chown=1000:1000 \
    --link \
    "/etc/ssl/certs/ca-certificates.crt" "/etc/ssl/certs/"
COPY \
    --from=builder \
    --chown=1000:1000 \
    --link \
    "/usr/share/zoneinfo" "/usr/share/zoneinfo"
COPY \
    --from=builder \
    --chown=1000:1000 \
    --link \
    "/go/src/app/private-location" "/opt/bin/private-location"
USER 0:0
RUN <<EOF
apt-get update
apt-get install -y --no-install-recommends wget
rm -rf /var/lib/apt/lists/*
EOF
USER 1000:1000
EXPOSE 8080
HEALTHCHECK \
    --interval=15s \
    --timeout=10s \
    --start-period=30s \
    --retries=3 \
    CMD wget -q -O /dev/null http://localhost:8080/health || exit 1
CMD ["/opt/bin/private-location"]