forked from hashicorp/dev-portal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
39 lines (30 loc) · 910 Bytes
/
Dockerfile
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
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0
FROM docker.mirror.hashicorp.services/node:18-alpine AS deps
RUN apk add --update --no-cache \
autoconf \
automake \
bash \
git \
g++ \
libtool \
libc6-compat \
libjpeg-turbo-dev \
libpng-dev \
make \
nasm
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm install -g npm@latest
# While imagemin/optipng-bin doesn't support arm64, set this env var as a workaround
# - `npm ls imagemin`
# - see https://github.com/imagemin/optipng-bin/issues/118
RUN CPPFLAGS="-DPNG_ARM_NEON_OPT=0" npm install
FROM docker.mirror.hashicorp.services/node:18-alpine AS builder
RUN npm install -g npm@latest
WORKDIR /app
COPY . ./website-preview
COPY --chown=0:0 --from=deps /app/node_modules ./website-preview/node_modules
EXPOSE 3000
ENTRYPOINT ["/bin/sh", "-c"]
CMD ["cd website-preview && ./scripts/content-repo-preview/start.sh"]