Skip to content

Commit 08ca935

Browse files
authored
repo sync
2 parents ad90a7d + c640f6d commit 08ca935

2 files changed

Lines changed: 36 additions & 2 deletions

File tree

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Make sure the Docker container still builds
2+
3+
name: Build Docker image
4+
5+
on:
6+
push:
7+
branches:
8+
- main
9+
pull_request:
10+
branches-ignore:
11+
- translations
12+
13+
env:
14+
CI: true
15+
16+
jobs:
17+
build:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Check out repo
21+
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
22+
- name: Build the container
23+
run: docker build .

Dockerfile

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,21 @@
77
# A temporary image that installs production-only dependencies
88

99
FROM node:14-alpine as installation
10+
RUN apk add --no-cache python make g++
1011
ENV NODE_ENV production
1112
WORKDIR /usr/src/docs
1213
COPY 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

2122
FROM node:14-alpine as bundles
23+
RUN apk add --no-cache python make g++
24+
ENV NODE_ENV production
2225
WORKDIR /usr/src/docs
2326
# Install the files used to create the bundles
2427
COPY package*.json ./
@@ -27,7 +30,8 @@ COPY stylesheets ./stylesheets
2730
COPY lib ./lib
2831
COPY 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
5357
ENV 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
5663
COPY --chown=node:node assets ./assets
5764
COPY --chown=node:node content ./content
5865
COPY --chown=node:node data ./data
5966
COPY --chown=node:node includes ./includes
67+
COPY --chown=node:node layouts ./layouts
6068
COPY --chown=node:node lib ./lib
6169
COPY --chown=node:node middleware ./middleware
6270
COPY --chown=node:node translations ./translations
6371
COPY --chown=node:node server.js ./server.js
6472
COPY --chown=node:node package*.json ./
73+
COPY --chown=node:node feature-flags.json ./
6574

75+
EXPOSE 80
6676
EXPOSE 443
77+
EXPOSE 4000
6778
CMD ["node", "server.js"]

0 commit comments

Comments
 (0)