77# A temporary image that installs production-only dependencies
88
99FROM node:14-alpine as installation
10+ RUN apk add --no-cache python make g++
1011ENV NODE_ENV production
1112WORKDIR /usr/src/docs
1213COPY package*.json ./
1314
1415# Install the project's dependencies
15- RUN npm ci
16+ RUN npm ci --production
1617
1718# --------------------------------------------------------------------------------
1819# BUNDLE IMAGE
1920# A temporary image that installs dependencies and builds the production-ready front-end bundles.
2021
2122FROM node:14-alpine as bundles
23+ RUN apk add --no-cache python make g++
24+ ENV NODE_ENV production
2225WORKDIR /usr/src/docs
2326# Install the files used to create the bundles
2427COPY package*.json ./
@@ -27,7 +30,8 @@ COPY stylesheets ./stylesheets
2730COPY lib ./lib
2831COPY webpack.config.js ./webpack.config.js
2932# Install the project's dependencies and build the bundles
30- RUN npm ci && npm run build
33+ RUN npm ci --production
34+ RUN npm run build
3135
3236# --------------------------------------------------------------------------------
3337# MAIN IMAGE
@@ -52,16 +56,23 @@ COPY --chown=node:node --from=bundles /usr/src/docs/dist /usr/src/docs/dist
5256# We should always be running in production mode
5357ENV NODE_ENV production
5458
59+ # Use Lunr instead of Algolia
60+ ENV USE_LUNR true
61+
5562# Copy only what's needed to run the server
5663COPY --chown=node:node assets ./assets
5764COPY --chown=node:node content ./content
5865COPY --chown=node:node data ./data
5966COPY --chown=node:node includes ./includes
67+ COPY --chown=node:node layouts ./layouts
6068COPY --chown=node:node lib ./lib
6169COPY --chown=node:node middleware ./middleware
6270COPY --chown=node:node translations ./translations
6371COPY --chown=node:node server.js ./server.js
6472COPY --chown=node:node package*.json ./
73+ COPY --chown=node:node feature-flags.json ./
6574
75+ EXPOSE 80
6676EXPOSE 443
77+ EXPOSE 4000
6778CMD ["node" , "server.js" ]
0 commit comments