-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
34 lines (27 loc) · 919 Bytes
/
Dockerfile
File metadata and controls
34 lines (27 loc) · 919 Bytes
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
#syntax=docker/dockerfile:1.13-labs
ARG NODE_VERSION=23
FROM node:${NODE_VERSION}-alpine AS node
ARG NODE_ENV=production
ENV NODE_ENV=${NODE_ENV}
FROM node AS builder
ENV NO_UPDATE_NOTIFIER=true
WORKDIR /build
RUN --mount=type=bind,source=package.json,target=package.json \
--mount=type=bind,source=package-lock.json,target=package-lock.json \
--mount=type=cache,target=/root/.npm \
npm ci --no-audit --no-fund --include=dev
COPY --link src ./src
COPY --link public ./public
COPY --link *.ts *.json index.html ./
RUN --mount=type=cache,target=/root/.npm \
npm run build
FROM caddy:2-alpine
WORKDIR /app
ENV GRAPHQL_ENDPOINT=http://localhost:4000/graphql
COPY --link --from=builder /build/dist ./dist
COPY --link ./Caddyfile /etc/caddy/Caddyfile
EXPOSE 80
EXPOSE 2019
EXPOSE 2020
HEALTHCHECK --interval=30s --timeout=4s --start-period=1s \
CMD ["wget", "-qO=-", "http://127.0.0.1:2020/health"]