-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathDockerfile.dev
37 lines (30 loc) · 1.24 KB
/
Dockerfile.dev
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
# Note: This Dockerfile creates an image intended ONLY for local development and testing
# it may contain unnessary source code and artifacts that are NOT intended for deployment
FROM node:20-bookworm-slim
WORKDIR /app
# Note: don't copy all source code immediately
# just grab the package file and npm ci dependencies
# that way, the expensive dependency install can be performed ONCE in a layer
# and it's inexpensive to rebuild the container when
# modifications are made to the source code in subsequent layers
COPY package*.json hadolint.sha512 ./
# hadolint: hadlolint unavailable via apt, so use the binary from GitHub
# it doesn't include a file checksum, so use one we've generated to validate the package
# hadolint ignore=DL3008
RUN apt-get update && \
apt-get upgrade -y && \
apt-get install -y --no-install-recommends jq wget ca-certificates make && \
wget --quiet \
https://github.com/hadolint/hadolint/releases/download/v2.10.0/hadolint-Linux-x86_64 \
-O ./hadolint && \
sha512sum -c hadolint.sha512 && \
chmod 0766 ./hadolint && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# hadolint ignore=DL3059
RUN npm install -g npm@^10.2.5 && \
npm ci && \
npm install -g serve@^14.2.1 && \
npm ls -a
COPY . .
CMD ["npm", "run", "start"]