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