diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000..be0443ae --- /dev/null +++ b/.dockerignore @@ -0,0 +1,2 @@ +node_modules/ +.git/ diff --git a/Dockerfile b/Dockerfile index 30640034..751e1e88 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,20 +1,18 @@ ## Builder -FROM node:14-alpine as builder +FROM node:17.4.0-alpine3.15 as builder WORKDIR /src +COPY package.json package-lock.json /src +RUN npm ci COPY . /src -RUN npm install \ - && npm run build +RUN npm run build ## App -FROM nginx:alpine +FROM nginx:1.21.6-alpine COPY --from=builder /src/dist /app -# Insert wasm type into Nginx mime.types file so they load correctly. -RUN sed -i '3i\ \ \ \ application/wasm wasm\;' /etc/nginx/mime.types - RUN rm -rf /usr/share/nginx/html \ && ln -s /app /usr/share/nginx/html