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# ca-certs
6FROM debian@sha256:b32674fb57780ad57d7b0749242d3f585f462f4ec4a60ae0adacd945f9cb9734 AS ca-certs
7LABEL \
8 org.opencontainers.image.base.digest="sha256:b32674fb57780ad57d7b0749242d3f585f462f4ec4a60ae0adacd945f9cb9734" \
9 org.opencontainers.image.base.name="docker.io/debian:bullseye-slim"
10RUN apt update && apt install -y ca-certificates curl && update-ca-certificates
11
12# docker
13FROM oven/bun@sha256:f20d9cf365ab35529384f1717687c739c92e6f39157a35a95ef06f4049a10e4a AS docker
14LABEL \
15 org.opencontainers.image.base.digest="sha256:f20d9cf365ab35529384f1717687c739c92e6f39157a35a95ef06f4049a10e4a" \
16 org.opencontainers.image.base.name="docker.io/oven/bun:1.3.6"
17WORKDIR /app/apps/workflows
18COPY \
19 --link \
20 "." "/app/"
21RUN bun run src/build-docker.ts
22
23# install
24FROM oven/bun@sha256:f20d9cf365ab35529384f1717687c739c92e6f39157a35a95ef06f4049a10e4a AS install
25LABEL \
26 org.opencontainers.image.base.digest="sha256:f20d9cf365ab35529384f1717687c739c92e6f39157a35a95ef06f4049a10e4a" \
27 org.opencontainers.image.base.name="docker.io/oven/bun:1.3.6" \
28 org.opencontainers.image.stage="install"
29WORKDIR /app/
30RUN \
31 --mount=type=bind,target=bunfig.toml,source=bunfig.toml \
32 --mount=type=bind,target=package.json,source=package.json \
33 --mount=type=bind,target=apps/workflows/package.json,source=apps/workflows/package.json \
34 --mount=type=bind,target=packages/assertions/package.json,source=packages/assertions/package.json \
35 --mount=type=bind,target=packages/db/package.json,source=packages/db/package.json \
36 --mount=type=bind,target=packages/emails/package.json,source=packages/emails/package.json \
37 --mount=type=bind,target=packages/notifications/discord/package.json,source=packages/notifications/discord/package.json \
38 --mount=type=bind,target=packages/notifications/email/package.json,source=packages/notifications/email/package.json \
39 --mount=type=bind,target=packages/notifications/google-chat/package.json,source=packages/notifications/google-chat/package.json \
40 --mount=type=bind,target=packages/notifications/ntfy/package.json,source=packages/notifications/ntfy/package.json \
41 --mount=type=bind,target=packages/notifications/opsgenie/package.json,source=packages/notifications/opsgenie/package.json \
42 --mount=type=bind,target=packages/notifications/pagerduty/package.json,source=packages/notifications/pagerduty/package.json \
43 --mount=type=bind,target=packages/notifications/slack/package.json,source=packages/notifications/slack/package.json \
44 --mount=type=bind,target=packages/notifications/telegram/package.json,source=packages/notifications/telegram/package.json \
45 --mount=type=bind,target=packages/notifications/twillio-whatsapp/package.json,source=packages/notifications/twillio-whatsapp/package.json \
46 --mount=type=bind,target=packages/notifications/twillio-sms/package.json,source=packages/notifications/twillio-sms/package.json \
47 --mount=type=bind,target=packages/notifications/webhook/package.json,source=packages/notifications/webhook/package.json \
48 --mount=type=bind,target=packages/regions/package.json,source=packages/regions/package.json \
49 --mount=type=bind,target=packages/utils/package.json,source=packages/utils/package.json \
50 --mount=type=bind,target=packages/tsconfig/package.json,source=packages/tsconfig/package.json \
51 --mount=type=bind,target=packages/tinybird/package.json,source=packages/tinybird/package.json \
52 --mount=type=bind,target=packages/upstash/package.json,source=packages/upstash/package.json \
53 --mount=type=bind,target=packages/theme-store/package.json,source=packages/theme-store/package.json \
54 --mount=type=cache,target=/root/.bun/install/cache,sharing=locked \
55 bun install --production --frozen-lockfile --verbose
56
57# build
58FROM oven/bun@sha256:f20d9cf365ab35529384f1717687c739c92e6f39157a35a95ef06f4049a10e4a AS build
59LABEL \
60 org.opencontainers.image.base.digest="sha256:f20d9cf365ab35529384f1717687c739c92e6f39157a35a95ef06f4049a10e4a" \
61 org.opencontainers.image.base.name="docker.io/oven/bun:1.3.6" \
62 org.opencontainers.image.stage="build"
63ENV NODE_ENV="production"
64WORKDIR /app/apps/workflows
65COPY \
66 --link \
67 "." "/app/"
68COPY \
69 --from=install \
70 --link \
71 "/app/node_modules" "/app/node_modules"
72RUN bun build --compile --target bun --sourcemap src/index.ts --outfile=app
73
74# libsql
75FROM oven/bun@sha256:f20d9cf365ab35529384f1717687c739c92e6f39157a35a95ef06f4049a10e4a AS libsql
76LABEL \
77 org.opencontainers.image.base.digest="sha256:f20d9cf365ab35529384f1717687c739c92e6f39157a35a95ef06f4049a10e4a" \
78 org.opencontainers.image.base.name="docker.io/oven/bun:1.3.6"
79WORKDIR /app/
80COPY \
81 --from=docker \
82 --link \
83 "/app/apps/build-docker/package.json" "/app/package.json"
84RUN bun install
85
86# runtime
87FROM debian@sha256:b32674fb57780ad57d7b0749242d3f585f462f4ec4a60ae0adacd945f9cb9734 AS runtime
88LABEL \
89 io.dofigen.version="2.6.0" \
90 org.opencontainers.image.authors="OpenStatus Team" \
91 org.opencontainers.image.base.digest="sha256:b32674fb57780ad57d7b0749242d3f585f462f4ec4a60ae0adacd945f9cb9734" \
92 org.opencontainers.image.base.name="docker.io/debian:bullseye-slim" \
93 org.opencontainers.image.description="Background job processing and probe scheduling for OpenStatus" \
94 org.opencontainers.image.source="https://github.com/openstatusHQ/openstatus" \
95 org.opencontainers.image.title="OpenStatus Workflows" \
96 org.opencontainers.image.vendor="OpenStatus"
97WORKDIR /app/
98COPY \
99 --from=build \
100 --chown=1000:1000 \
101 --chmod=555 \
102 --link \
103 "/app/apps/workflows/app" "/app/apps/workflows/"
104COPY \
105 --from=libsql \
106 --chown=1000:1000 \
107 --link \
108 "/app/node_modules" "/app/packages/db/node_modules"
109COPY \
110 --from=libsql \
111 --chown=1000:1000 \
112 --link \
113 "/app/node_modules" "/app/node_modules"
114COPY \
115 --from=ca-certs \
116 --chown=1000:1000 \
117 --link \
118 "/etc/ssl/certs/ca-certificates.crt" "/etc/ssl/certs/"
119COPY \
120 --from=ca-certs \
121 --chown=1000:1000 \
122 --link \
123 "/usr/bin/curl" "/usr/bin/curl"
124USER 1000:1000
125EXPOSE 3000
126ENTRYPOINT ["/app/apps/workflows/app"]