Openstatus
www.openstatus.dev
1# syntax=docker/dockerfile:1.19.0
2# This file is generated by Dofigen v2.6.0
3# See https://github.com/lenra-io/dofigen
4
5# install
6FROM oven/bun@sha256:f20d9cf365ab35529384f1717687c739c92e6f39157a35a95ef06f4049a10e4a AS install
7LABEL \
8 org.opencontainers.image.base.digest="sha256:f20d9cf365ab35529384f1717687c739c92e6f39157a35a95ef06f4049a10e4a" \
9 org.opencontainers.image.base.name="docker.io/oven/bun:1.3.6" \
10 org.opencontainers.image.stage="install"
11WORKDIR /app/
12RUN \
13 --mount=type=bind,target=bunfig.toml,source=bunfig.toml \
14 --mount=type=bind,target=package.json,source=package.json \
15 --mount=type=bind,target=apps/server/package.json,source=apps/server/package.json \
16 --mount=type=bind,target=packages/analytics/package.json,source=packages/analytics/package.json \
17 --mount=type=bind,target=packages/db/package.json,source=packages/db/package.json \
18 --mount=type=bind,target=packages/emails/package.json,source=packages/emails/package.json \
19 --mount=type=bind,target=packages/error/package.json,source=packages/error/package.json \
20 --mount=type=bind,target=packages/regions/package.json,source=packages/regions/package.json \
21 --mount=type=bind,target=packages/tinybird/package.json,source=packages/tinybird/package.json \
22 --mount=type=bind,target=packages/tracker/package.json,source=packages/tracker/package.json \
23 --mount=type=bind,target=packages/upstash/package.json,source=packages/upstash/package.json \
24 --mount=type=bind,target=packages/utils/package.json,source=packages/utils/package.json \
25 --mount=type=bind,target=packages/tsconfig/package.json,source=packages/tsconfig/package.json \
26 --mount=type=bind,target=packages/assertions/package.json,source=packages/assertions/package.json \
27 --mount=type=bind,target=packages/theme-store/package.json,source=packages/theme-store/package.json \
28 --mount=type=cache,target=/root/.bun/install/cache,sharing=locked \
29 bun install --production --frozen-lockfile --verbose
30
31# build
32FROM oven/bun@sha256:f20d9cf365ab35529384f1717687c739c92e6f39157a35a95ef06f4049a10e4a AS build
33LABEL \
34 org.opencontainers.image.base.digest="sha256:f20d9cf365ab35529384f1717687c739c92e6f39157a35a95ef06f4049a10e4a" \
35 org.opencontainers.image.base.name="docker.io/oven/bun:1.3.6" \
36 org.opencontainers.image.stage="build"
37ENV NODE_ENV="production"
38WORKDIR /app/apps/server
39COPY \
40 --link \
41 "." "/app/"
42COPY \
43 --from=install \
44 --link \
45 "/app/node_modules" "/app/node_modules"
46RUN bun build --compile --sourcemap src/index.ts --outfile=app
47
48# runtime
49FROM debian@sha256:c5f48c942c667e70d7e64b124cfc939c25a4a43207c0d14b45844d762dc1d50f AS runtime
50LABEL \
51 io.dofigen.version="2.6.0" \
52 org.opencontainers.image.authors="OpenStatus Team" \
53 org.opencontainers.image.base.digest="sha256:c5f48c942c667e70d7e64b124cfc939c25a4a43207c0d14b45844d762dc1d50f" \
54 org.opencontainers.image.base.name="docker.io/debian:bullseye-slim" \
55 org.opencontainers.image.description="REST API server with Hono framework for OpenStatus" \
56 org.opencontainers.image.source="https://github.com/openstatusHQ/openstatus" \
57 org.opencontainers.image.title="OpenStatus Server" \
58 org.opencontainers.image.vendor="OpenStatus"
59COPY \
60 --from=build \
61 --chown=1000:1000 \
62 --chmod=555 \
63 --link \
64 "/app/apps/server/app" "/bin/"
65USER 0:0
66RUN <<EOF
67apt-get update
68apt-get install -y --no-install-recommends curl
69rm -rf /var/lib/apt/lists/*
70EOF
71USER 1000:1000
72EXPOSE 3000
73HEALTHCHECK \
74 --interval=30s \
75 --timeout=10s \
76 --start-period=30s \
77 --retries=3 \
78 CMD curl -f http://localhost:3000/ping || exit 1
79ENTRYPOINT ["/bin/app"]