Openstatus www.openstatus.dev
at main 80 lines 3.8 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# install 6FROM oven/bun@sha256:f20d9cf365ab35529384f1717687c739c92e6f39157a35a95ef06f4049a10e4a AS install 7LABEL \ 8 org.opencontainers.image.base.digest="sha256:f20d9cf365ab35529384f1717687c739c92e6f39157a35a95ef06f4049a10e4a" \ 9 org.opencontainers.image.base.name="docker.io/oven/bun:1.3.6" \ 10 org.opencontainers.image.stage="install" 11WORKDIR /app/ 12RUN \ 13 --mount=type=bind,target=bunfig.toml,source=bunfig.toml \ 14 --mount=type=bind,target=package.json,source=package.json \ 15 --mount=type=bind,target=apps/server/package.json,source=apps/server/package.json \ 16 --mount=type=bind,target=packages/analytics/package.json,source=packages/analytics/package.json \ 17 --mount=type=bind,target=packages/db/package.json,source=packages/db/package.json \ 18 --mount=type=bind,target=packages/proto/package.json,source=packages/proto/package.json \ 19 --mount=type=bind,target=packages/emails/package.json,source=packages/emails/package.json \ 20 --mount=type=bind,target=packages/error/package.json,source=packages/error/package.json \ 21 --mount=type=bind,target=packages/regions/package.json,source=packages/regions/package.json \ 22 --mount=type=bind,target=packages/tinybird/package.json,source=packages/tinybird/package.json \ 23 --mount=type=bind,target=packages/tracker/package.json,source=packages/tracker/package.json \ 24 --mount=type=bind,target=packages/upstash/package.json,source=packages/upstash/package.json \ 25 --mount=type=bind,target=packages/utils/package.json,source=packages/utils/package.json \ 26 --mount=type=bind,target=packages/tsconfig/package.json,source=packages/tsconfig/package.json \ 27 --mount=type=bind,target=packages/assertions/package.json,source=packages/assertions/package.json \ 28 --mount=type=bind,target=packages/theme-store/package.json,source=packages/theme-store/package.json \ 29 --mount=type=cache,target=/root/.bun/install/cache,sharing=locked \ 30 bun install --production --frozen-lockfile --verbose 31 32# build 33FROM oven/bun@sha256:f20d9cf365ab35529384f1717687c739c92e6f39157a35a95ef06f4049a10e4a AS build 34LABEL \ 35 org.opencontainers.image.base.digest="sha256:f20d9cf365ab35529384f1717687c739c92e6f39157a35a95ef06f4049a10e4a" \ 36 org.opencontainers.image.base.name="docker.io/oven/bun:1.3.6" \ 37 org.opencontainers.image.stage="build" 38ENV NODE_ENV="production" 39WORKDIR /app/apps/server 40COPY \ 41 --link \ 42 "." "/app/" 43COPY \ 44 --from=install \ 45 --link \ 46 "/app/node_modules" "/app/node_modules" 47RUN bun build --compile --sourcemap src/index.ts --outfile=app 48 49# runtime 50FROM debian@sha256:b32674fb57780ad57d7b0749242d3f585f462f4ec4a60ae0adacd945f9cb9734 AS runtime 51LABEL \ 52 io.dofigen.version="2.6.0" \ 53 org.opencontainers.image.authors="OpenStatus Team" \ 54 org.opencontainers.image.base.digest="sha256:b32674fb57780ad57d7b0749242d3f585f462f4ec4a60ae0adacd945f9cb9734" \ 55 org.opencontainers.image.base.name="docker.io/debian:bullseye-slim" \ 56 org.opencontainers.image.description="REST API server with Hono framework for OpenStatus" \ 57 org.opencontainers.image.source="https://github.com/openstatusHQ/openstatus" \ 58 org.opencontainers.image.title="OpenStatus Server" \ 59 org.opencontainers.image.vendor="OpenStatus" 60COPY \ 61 --from=build \ 62 --chown=1000:1000 \ 63 --chmod=555 \ 64 --link \ 65 "/app/apps/server/app" "/bin/" 66USER 0:0 67RUN <<EOF 68apt-get update 69apt-get install -y --no-install-recommends curl 70rm -rf /var/lib/apt/lists/* 71EOF 72USER 1000:1000 73EXPOSE 3000 74HEALTHCHECK \ 75 --interval=30s \ 76 --timeout=10s \ 77 --start-period=30s \ 78 --retries=3 \ 79 CMD curl -f http://localhost:3000/ping || exit 1 80ENTRYPOINT ["/bin/app"]