Openstatus
www.openstatus.dev
1# syntax=docker/dockerfile:1.11
2# This file is generated by Dofigen v2.5.0
3# See https://github.com/lenra-io/dofigen
4
5# install
6FROM oven/bun@sha256:00cccad6e9c66bbacc250851f689168606aaea551ac473e908bbcf00a5645025 AS install
7LABEL \
8 org.opencontainers.image.base.digest="sha256:00cccad6e9c66bbacc250851f689168606aaea551ac473e908bbcf00a5645025" \
9 org.opencontainers.image.base.name="docker.io/oven/bun:1.3.0"
10WORKDIR /app/
11RUN \
12 --mount=type=bind,target=bunfig.toml,source=bunfig.toml \
13 --mount=type=bind,target=package.json,source=package.json \
14 --mount=type=bind,target=apps/workflows/package.json,source=apps/workflows/package.json \
15 --mount=type=bind,target=packages/assertions/package.json,source=packages/assertions/package.json \
16 --mount=type=bind,target=packages/db/package.json,source=packages/db/package.json \
17 --mount=type=bind,target=packages/emails/package.json,source=packages/emails/package.json \
18 --mount=type=bind,target=packages/notifications/discord/package.json,source=packages/notifications/discord/package.json \
19 --mount=type=bind,target=packages/notifications/email/package.json,source=packages/notifications/email/package.json \
20 --mount=type=bind,target=packages/notifications/ntfy/package.json,source=packages/notifications/ntfy/package.json \
21 --mount=type=bind,target=packages/notifications/opsgenie/package.json,source=packages/notifications/opsgenie/package.json \
22 --mount=type=bind,target=packages/notifications/pagerduty/package.json,source=packages/notifications/pagerduty/package.json \
23 --mount=type=bind,target=packages/notifications/slack/package.json,source=packages/notifications/slack/package.json \
24 --mount=type=bind,target=packages/notifications/twillio-sms/package.json,source=packages/notifications/twillio-sms/package.json \
25 --mount=type=bind,target=packages/notifications/webhook/package.json,source=packages/notifications/webhook/package.json \
26 --mount=type=bind,target=packages/regions/package.json,source=packages/regions/package.json \
27 --mount=type=bind,target=packages/utils/package.json,source=packages/utils/package.json \
28 --mount=type=bind,target=packages/tsconfig/package.json,source=packages/tsconfig/package.json \
29 --mount=type=bind,target=packages/tinybird/package.json,source=packages/tinybird/package.json \
30 --mount=type=bind,target=packages/upstash/package.json,source=packages/upstash/package.json \
31 --mount=type=bind,target=packages/theme-store/package.json,source=packages/theme-store/package.json \
32 --mount=type=cache,target=/root/.bun/install/cache,sharing=locked \
33 bun install --production --frozen-lockfile --verbose
34
35# build
36FROM oven/bun@sha256:00cccad6e9c66bbacc250851f689168606aaea551ac473e908bbcf00a5645025 AS build
37LABEL \
38 org.opencontainers.image.base.digest="sha256:00cccad6e9c66bbacc250851f689168606aaea551ac473e908bbcf00a5645025" \
39 org.opencontainers.image.base.name="docker.io/oven/bun:1.3.0"
40ENV NODE_ENV="production"
41WORKDIR /app/apps/workflows
42COPY \
43 --link \
44 "." "/app/"
45COPY \
46 --from=install \
47 --link \
48 "/app/node_modules" "/app/node_modules"
49RUN bun build --compile --target bun --sourcemap --format=cjs src/index.ts --outfile=app --external '@libsql/*' --external libsql
50
51# ca-certs
52FROM debian@sha256:52927eff8153b563244f98cdc802ba97918afcdf67f9e4867cbf1f7afb3d147b AS ca-certs
53LABEL \
54 org.opencontainers.image.base.digest="sha256:52927eff8153b563244f98cdc802ba97918afcdf67f9e4867cbf1f7afb3d147b" \
55 org.opencontainers.image.base.name="docker.io/debian:bullseye-slim"
56RUN apt update && apt install -y ca-certificates && update-ca-certificates
57
58# docker
59FROM oven/bun@sha256:9c5d3c92b234b4708198577d2f39aab7397a242a40da7c2f059e51b9dc62b408 AS docker
60LABEL \
61 org.opencontainers.image.base.digest="sha256:9c5d3c92b234b4708198577d2f39aab7397a242a40da7c2f059e51b9dc62b408" \
62 org.opencontainers.image.base.name="docker.io/oven/bun:1.3.1"
63WORKDIR /app/apps/workflows
64COPY \
65 --link \
66 "." "/app/"
67RUN bun run src/build-docker.ts
68
69# libsql
70FROM oven/bun@sha256:00cccad6e9c66bbacc250851f689168606aaea551ac473e908bbcf00a5645025 AS libsql
71LABEL \
72 org.opencontainers.image.base.digest="sha256:00cccad6e9c66bbacc250851f689168606aaea551ac473e908bbcf00a5645025" \
73 org.opencontainers.image.base.name="docker.io/oven/bun:1.3.0"
74WORKDIR /app/
75COPY \
76 --from=docker \
77 --link \
78 "/app/apps/build-docker/package.json" "/app/package.json"
79RUN bun install
80
81# runtime
82FROM debian@sha256:52927eff8153b563244f98cdc802ba97918afcdf67f9e4867cbf1f7afb3d147b AS runtime
83LABEL \
84 io.dofigen.version="2.5.0" \
85 org.opencontainers.image.base.digest="sha256:52927eff8153b563244f98cdc802ba97918afcdf67f9e4867cbf1f7afb3d147b" \
86 org.opencontainers.image.base.name="docker.io/debian:bullseye-slim"
87WORKDIR /app/
88COPY \
89 --from=build \
90 --chown=1000:1000 \
91 --chmod=555 \
92 --link \
93 "/app/apps/workflows/app" "/app/apps/workflows/"
94COPY \
95 --from=libsql \
96 --chown=1000:1000 \
97 --link \
98 "/app/node_modules" "/app/packages/db/node_modules"
99COPY \
100 --from=libsql \
101 --chown=1000:1000 \
102 --link \
103 "/app/node_modules" "/app/node_modules"
104COPY \
105 --from=ca-certs \
106 --chown=1000:1000 \
107 --link \
108 "/etc/ssl/certs/ca-certificates.crt" "/etc/ssl/certs/"
109USER 1000:1000
110EXPOSE 3000
111ENTRYPOINT ["/app/apps/workflows/app"]