Openstatus www.openstatus.dev
at b4577f2e537d91b7369cd1bbd615cfb4730d8b2f 138 lines 6.4 kB view raw
1# syntax=docker/dockerfile:1.11 2# This file is generated by Dofigen v2.5.1 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" \ 10 org.opencontainers.image.stage="ca-certs" 11RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates && update-ca-certificates && rm -rf /var/lib/apt/lists/* 12 13# docker 14FROM oven/bun@sha256:fbf8e67e9d3b806c86be7a2f2e9bae801f2d9212a21db4dcf8cc9889f5a3c9c4 AS docker 15LABEL \ 16 org.opencontainers.image.base.digest="sha256:fbf8e67e9d3b806c86be7a2f2e9bae801f2d9212a21db4dcf8cc9889f5a3c9c4" \ 17 org.opencontainers.image.base.name="docker.io/oven/bun:1.3.3" \ 18 org.opencontainers.image.stage="docker" 19WORKDIR /app/apps/workflows 20COPY \ 21 --link \ 22 "." "/app/" 23RUN bun run src/build-docker.ts 24 25# install 26FROM oven/bun@sha256:fbf8e67e9d3b806c86be7a2f2e9bae801f2d9212a21db4dcf8cc9889f5a3c9c4 AS install 27LABEL \ 28 org.opencontainers.image.base.digest="sha256:fbf8e67e9d3b806c86be7a2f2e9bae801f2d9212a21db4dcf8cc9889f5a3c9c4" \ 29 org.opencontainers.image.base.name="docker.io/oven/bun:1.3.3" \ 30 org.opencontainers.image.stage="install" 31WORKDIR /app/ 32RUN \ 33 --mount=type=bind,target=bunfig.toml,source=bunfig.toml \ 34 --mount=type=bind,target=package.json,source=package.json \ 35 --mount=type=bind,target=apps/workflows/package.json,source=apps/workflows/package.json \ 36 --mount=type=bind,target=packages/assertions/package.json,source=packages/assertions/package.json \ 37 --mount=type=bind,target=packages/db/package.json,source=packages/db/package.json \ 38 --mount=type=bind,target=packages/emails/package.json,source=packages/emails/package.json \ 39 --mount=type=bind,target=packages/notifications/discord/package.json,source=packages/notifications/discord/package.json \ 40 --mount=type=bind,target=packages/notifications/email/package.json,source=packages/notifications/email/package.json \ 41 --mount=type=bind,target=packages/notifications/ntfy/package.json,source=packages/notifications/ntfy/package.json \ 42 --mount=type=bind,target=packages/notifications/opsgenie/package.json,source=packages/notifications/opsgenie/package.json \ 43 --mount=type=bind,target=packages/notifications/pagerduty/package.json,source=packages/notifications/pagerduty/package.json \ 44 --mount=type=bind,target=packages/notifications/slack/package.json,source=packages/notifications/slack/package.json \ 45 --mount=type=bind,target=packages/notifications/twillio-sms/package.json,source=packages/notifications/twillio-sms/package.json \ 46 --mount=type=bind,target=packages/notifications/webhook/package.json,source=packages/notifications/webhook/package.json \ 47 --mount=type=bind,target=packages/regions/package.json,source=packages/regions/package.json \ 48 --mount=type=bind,target=packages/utils/package.json,source=packages/utils/package.json \ 49 --mount=type=bind,target=packages/tsconfig/package.json,source=packages/tsconfig/package.json \ 50 --mount=type=bind,target=packages/tinybird/package.json,source=packages/tinybird/package.json \ 51 --mount=type=bind,target=packages/upstash/package.json,source=packages/upstash/package.json \ 52 --mount=type=bind,target=packages/theme-store/package.json,source=packages/theme-store/package.json \ 53 --mount=type=cache,target=/root/.bun/install/cache,sharing=locked \ 54 bun install --production --frozen-lockfile --verbose 55 56# build 57FROM oven/bun@sha256:fbf8e67e9d3b806c86be7a2f2e9bae801f2d9212a21db4dcf8cc9889f5a3c9c4 AS build 58LABEL \ 59 org.opencontainers.image.base.digest="sha256:fbf8e67e9d3b806c86be7a2f2e9bae801f2d9212a21db4dcf8cc9889f5a3c9c4" \ 60 org.opencontainers.image.base.name="docker.io/oven/bun:1.3.3" \ 61 org.opencontainers.image.stage="build" 62ENV NODE_ENV="production" 63WORKDIR /app/apps/workflows 64COPY \ 65 --link \ 66 "." "/app/" 67COPY \ 68 --from=install \ 69 --link \ 70 "/app/node_modules" "/app/node_modules" 71RUN bun build --compile --target bun --sourcemap --format=cjs src/index.ts --outfile=app --external '@libsql/*' --external libsql 72 73# libsql 74FROM oven/bun@sha256:fbf8e67e9d3b806c86be7a2f2e9bae801f2d9212a21db4dcf8cc9889f5a3c9c4 AS libsql 75LABEL \ 76 org.opencontainers.image.base.digest="sha256:fbf8e67e9d3b806c86be7a2f2e9bae801f2d9212a21db4dcf8cc9889f5a3c9c4" \ 77 org.opencontainers.image.base.name="docker.io/oven/bun:1.3.3" \ 78 org.opencontainers.image.stage="libsql" 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:530a3348fc4b5734ffe1a137ddbcee6850154285251b53c3425c386ea8fac77b AS runtime 88LABEL \ 89 io.dofigen.version="2.5.1" \ 90 org.opencontainers.image.authors="OpenStatus Team" \ 91 org.opencontainers.image.base.digest="sha256:530a3348fc4b5734ffe1a137ddbcee6850154285251b53c3425c386ea8fac77b" \ 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=build \ 106 --chown=1000:1000 \ 107 --link \ 108 "/app/data" "/app/data" 109COPY \ 110 --from=libsql \ 111 --chown=1000:1000 \ 112 --link \ 113 "/app/node_modules" "/app/packages/db/node_modules" 114COPY \ 115 --from=libsql \ 116 --chown=1000:1000 \ 117 --link \ 118 "/app/node_modules" "/app/node_modules" 119COPY \ 120 --from=ca-certs \ 121 --chown=1000:1000 \ 122 --link \ 123 "/etc/ssl/certs/ca-certificates.crt" "/etc/ssl/certs/" 124USER 0:0 125RUN <<EOF 126apt-get update 127apt-get install -y --no-install-recommends curl 128rm -rf /var/lib/apt/lists/* 129EOF 130USER 1000:1000 131EXPOSE 3000 132HEALTHCHECK \ 133 --interval=30s \ 134 --timeout=10s \ 135 --start-period=30s \ 136 --retries=3 \ 137 CMD curl -f http://localhost:3000/ping || exit 1 138ENTRYPOINT ["/app/apps/workflows/app"]