-
-
Notifications
You must be signed in to change notification settings - Fork 692
Expand file tree
/
Copy pathDockerfile
More file actions
106 lines (103 loc) · 6.24 KB
/
Copy pathDockerfile
File metadata and controls
106 lines (103 loc) · 6.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# syntax=docker/dockerfile:1.19.0
# This file is generated by Dofigen v2.8.0
# See https://github.com/lenra-io/dofigen
# install
FROM node@sha256:b31e7a42fdf8b8aa5f5ed477c72d694301273f1069c5a2f71d53c6482e99a2fc AS install
LABEL \
org.opencontainers.image.base.digest="sha256:b31e7a42fdf8b8aa5f5ed477c72d694301273f1069c5a2f71d53c6482e99a2fc" \
org.opencontainers.image.base.name="docker.io/node:24-slim" \
org.opencontainers.image.stage="install"
WORKDIR /app/
RUN \
--mount=type=bind,target=pnpm-workspace.yaml,source=pnpm-workspace.yaml \
--mount=type=bind,target=pnpm-lock.yaml,source=pnpm-lock.yaml \
--mount=type=bind,target=package.json,source=package.json \
--mount=type=bind,target=apps/server/package.json,source=apps/server/package.json \
--mount=type=bind,target=packages/analytics/package.json,source=packages/analytics/package.json \
--mount=type=bind,target=packages/db/package.json,source=packages/db/package.json \
--mount=type=bind,target=packages/proto/package.json,source=packages/proto/package.json \
--mount=type=bind,target=packages/emails/package.json,source=packages/emails/package.json \
--mount=type=bind,target=packages/notifications/base/package.json,source=packages/notifications/base/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/grafana-oncall/package.json,source=packages/notifications/grafana-oncall/package.json \
--mount=type=bind,target=packages/notifications/google-chat/package.json,source=packages/notifications/google-chat/package.json \
--mount=type=bind,target=packages/notifications/ms-teams/package.json,source=packages/notifications/ms-teams/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/telegram/package.json,source=packages/notifications/telegram/package.json \
--mount=type=bind,target=packages/notifications/bird-whatsapp/package.json,source=packages/notifications/bird-whatsapp/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/error/package.json,source=packages/error/package.json \
--mount=type=bind,target=packages/regions/package.json,source=packages/regions/package.json \
--mount=type=bind,target=packages/tinybird/package.json,source=packages/tinybird/package.json \
--mount=type=bind,target=packages/tracker/package.json,source=packages/tracker/package.json \
--mount=type=bind,target=packages/upstash/package.json,source=packages/upstash/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/subscriptions/package.json,source=packages/subscriptions/package.json \
--mount=type=bind,target=packages/assertions/package.json,source=packages/assertions/package.json \
--mount=type=bind,target=packages/theme-store/package.json,source=packages/theme-store/package.json \
--mount=type=bind,target=packages/locales/package.json,source=packages/locales/package.json \
--mount=type=bind,target=packages/services/package.json,source=packages/services/package.json \
--mount=type=bind,target=packages/importers/package.json,source=packages/importers/package.json \
--mount=type=cache,target=/root/.local/share/pnpm/store,sharing=locked \
<<EOF
corepack enable pnpm
pnpm install --prod --frozen-lockfile --filter=@openstatus/server... --verbose
EOF
# build
FROM denoland/deno@sha256:8d24854de78a79c56e74b49aa4c5996c60e1fe3730efba8fbdd2692c582e6e29 AS build
LABEL \
org.opencontainers.image.base.digest="sha256:8d24854de78a79c56e74b49aa4c5996c60e1fe3730efba8fbdd2692c582e6e29" \
org.opencontainers.image.base.name="docker.io/denoland/deno:2.9.0" \
org.opencontainers.image.stage="build"
ENV NODE_ENV="production"
WORKDIR /app/apps/server
COPY \
--link \
"." "/app/"
COPY \
--from=install \
--link \
"/app/node_modules" "/app/node_modules"
COPY \
--from=install \
--link \
"/app/apps/server/node_modules" "/app/apps/server/node_modules"
COPY \
--from=install \
--link \
"/app/packages" "/app/packages"
RUN <<EOF
deno bundle --platform=deno --minify --sloppy-imports --node-modules-dir=manual --output src/_serve.bundle.mjs src/serve.ts
deno compile --no-check -A --node-modules-dir=none --include static/openapi.yaml --include static/openapi-v1.json --output app src/_serve.bundle.mjs
EOF
# runtime
FROM registry.access.redhat.com/hi/curl@sha256:848b81ab5d5e55371d7193fd4f1ea7b605d14dbb039344ffad34a4c1f0d880f4 AS runtime
LABEL \
io.dofigen.version="2.8.0" \
org.opencontainers.image.authors="OpenStatus Team" \
org.opencontainers.image.base.digest="sha256:848b81ab5d5e55371d7193fd4f1ea7b605d14dbb039344ffad34a4c1f0d880f4" \
org.opencontainers.image.description="REST API server with Hono framework for OpenStatus" \
org.opencontainers.image.source="https://github.com/openstatusHQ/openstatus" \
org.opencontainers.image.title="OpenStatus Server" \
org.opencontainers.image.vendor="OpenStatus"
COPY \
--from=build \
--chown=1000:1000 \
--chmod=555 \
--link \
"/app/apps/server/app" "/bin/"
USER 1000:1000
EXPOSE 3000
HEALTHCHECK \
--interval=30s \
--timeout=10s \
--start-period=30s \
--retries=3 \
CMD ["curl", "-f", "http://localhost:3000/ping"]
ENTRYPOINT ["/bin/app"]