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