# syntax=docker/dockerfile:1.11 # This file is generated by Dofigen v2.5.0 # See https://github.com/lenra-io/dofigen # install FROM oven/bun@sha256:00cccad6e9c66bbacc250851f689168606aaea551ac473e908bbcf00a5645025 AS install LABEL \ org.opencontainers.image.base.digest="sha256:00cccad6e9c66bbacc250851f689168606aaea551ac473e908bbcf00a5645025" \ org.opencontainers.image.base.name="docker.io/oven/bun:1.3.0" WORKDIR /app/ RUN \ --mount=type=bind,target=bunfig.toml,source=bunfig.toml \ --mount=type=bind,target=package.json,source=package.json \ --mount=type=bind,target=apps/workflows/package.json,source=apps/workflows/package.json \ --mount=type=bind,target=packages/assertions/package.json,source=packages/assertions/package.json \ --mount=type=bind,target=packages/db/package.json,source=packages/db/package.json \ --mount=type=bind,target=packages/emails/package.json,source=packages/emails/package.json \ --mount=type=bind,target=packages/notifications/discord/package.json,source=packages/notifications/discord/package.json \ --mount=type=bind,target=packages/notifications/email/package.json,source=packages/notifications/email/package.json \ --mount=type=bind,target=packages/notifications/ntfy/package.json,source=packages/notifications/ntfy/package.json \ --mount=type=bind,target=packages/notifications/opsgenie/package.json,source=packages/notifications/opsgenie/package.json \ --mount=type=bind,target=packages/notifications/pagerduty/package.json,source=packages/notifications/pagerduty/package.json \ --mount=type=bind,target=packages/notifications/slack/package.json,source=packages/notifications/slack/package.json \ --mount=type=bind,target=packages/notifications/twillio-sms/package.json,source=packages/notifications/twillio-sms/package.json \ --mount=type=bind,target=packages/notifications/webhook/package.json,source=packages/notifications/webhook/package.json \ --mount=type=bind,target=packages/regions/package.json,source=packages/regions/package.json \ --mount=type=bind,target=packages/utils/package.json,source=packages/utils/package.json \ --mount=type=bind,target=packages/tsconfig/package.json,source=packages/tsconfig/package.json \ --mount=type=bind,target=packages/tinybird/package.json,source=packages/tinybird/package.json \ --mount=type=bind,target=packages/upstash/package.json,source=packages/upstash/package.json \ --mount=type=bind,target=packages/theme-store/package.json,source=packages/theme-store/package.json \ --mount=type=cache,target=/root/.bun/install/cache,sharing=locked \ bun install --production --frozen-lockfile --verbose # build FROM oven/bun@sha256:00cccad6e9c66bbacc250851f689168606aaea551ac473e908bbcf00a5645025 AS build LABEL \ org.opencontainers.image.base.digest="sha256:00cccad6e9c66bbacc250851f689168606aaea551ac473e908bbcf00a5645025" \ org.opencontainers.image.base.name="docker.io/oven/bun:1.3.0" ENV NODE_ENV="production" WORKDIR /app/apps/workflows COPY \ --link \ "." "/app/" COPY \ --from=install \ --link \ "/app/node_modules" "/app/node_modules" RUN bun build --compile --target bun --sourcemap --format=cjs src/index.ts --outfile=app --external '@libsql/*' --external libsql # ca-certs FROM debian@sha256:52927eff8153b563244f98cdc802ba97918afcdf67f9e4867cbf1f7afb3d147b AS ca-certs LABEL \ org.opencontainers.image.base.digest="sha256:52927eff8153b563244f98cdc802ba97918afcdf67f9e4867cbf1f7afb3d147b" \ org.opencontainers.image.base.name="docker.io/debian:bullseye-slim" RUN apt update && apt install -y ca-certificates && update-ca-certificates # docker FROM oven/bun@sha256:9c5d3c92b234b4708198577d2f39aab7397a242a40da7c2f059e51b9dc62b408 AS docker LABEL \ org.opencontainers.image.base.digest="sha256:9c5d3c92b234b4708198577d2f39aab7397a242a40da7c2f059e51b9dc62b408" \ org.opencontainers.image.base.name="docker.io/oven/bun:1.3.1" WORKDIR /app/apps/workflows COPY \ --link \ "." "/app/" RUN bun run src/build-docker.ts # libsql FROM oven/bun@sha256:00cccad6e9c66bbacc250851f689168606aaea551ac473e908bbcf00a5645025 AS libsql LABEL \ org.opencontainers.image.base.digest="sha256:00cccad6e9c66bbacc250851f689168606aaea551ac473e908bbcf00a5645025" \ org.opencontainers.image.base.name="docker.io/oven/bun:1.3.0" WORKDIR /app/ COPY \ --from=docker \ --link \ "/app/apps/build-docker/package.json" "/app/package.json" RUN bun install # runtime FROM debian@sha256:52927eff8153b563244f98cdc802ba97918afcdf67f9e4867cbf1f7afb3d147b AS runtime LABEL \ io.dofigen.version="2.5.0" \ org.opencontainers.image.base.digest="sha256:52927eff8153b563244f98cdc802ba97918afcdf67f9e4867cbf1f7afb3d147b" \ org.opencontainers.image.base.name="docker.io/debian:bullseye-slim" WORKDIR /app/ COPY \ --from=build \ --chown=1000:1000 \ --chmod=555 \ --link \ "/app/apps/workflows/app" "/app/apps/workflows/" COPY \ --from=libsql \ --chown=1000:1000 \ --link \ "/app/node_modules" "/app/packages/db/node_modules" COPY \ --from=libsql \ --chown=1000:1000 \ --link \ "/app/node_modules" "/app/node_modules" COPY \ --from=ca-certs \ --chown=1000:1000 \ --link \ "/etc/ssl/certs/ca-certificates.crt" "/etc/ssl/certs/" USER 1000:1000 EXPOSE 3000 ENTRYPOINT ["/app/apps/workflows/app"]