-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
57 lines (31 loc) · 1.11 KB
/
Copy pathDockerfile
File metadata and controls
57 lines (31 loc) · 1.11 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
# syntax=docker/dockerfile:1
# =========================================================
# 📚 DEVALLTECT DOCS — MULTI-STAGE CONTAINER
# =========================================================
FROM node:20-bookworm-slim AS dependencies
ENV COREPACK_ENABLE_DOWNLOAD_PROMPT=0
WORKDIR /workspace
RUN corepack enable
RUN apt-get update \
&& apt-get install --yes --no-install-recommends make \
&& rm -rf /var/lib/apt/lists/*
COPY package.json yarn.lock .yarnrc.yml ./
COPY .yarn/releases/ .yarn/releases/
RUN yarn install --immutable
FROM dependencies AS development
COPY . .
EXPOSE 3000
CMD ["yarn", "start", "--host", "0.0.0.0"]
FROM dependencies AS validation
COPY . .
RUN yarn validate
FROM dependencies AS builder
COPY . .
RUN yarn build
FROM nginx:stable-alpine AS production
COPY docker/nginx.conf /etc/nginx/conf.d/default.conf
COPY --from=builder /workspace/build/ /usr/share/nginx/html/devalltect-docs/
EXPOSE 8080
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD wget --quiet --tries=1 --spider http://127.0.0.1:8080/healthz || exit 1
CMD ["nginx", "-g", "daemon off;"]