Skip to content

Commit c82c0ab

Browse files
authored
Update Dockerfile
1 parent aa79d22 commit c82c0ab

File tree

1 file changed

+16
-10
lines changed

1 file changed

+16
-10
lines changed

website/Dockerfile

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
1-
FROM node:18-alpine
2-
1+
# ==== CONFIGURE =====
2+
# Use a Node 16 base image
3+
FROM node:16-alpine
4+
# Set the working directory to /app inside the container
35
WORKDIR /app
4-
5-
COPY package.json .
6-
7-
RUN npm install
8-
RUN npm run build
9-
6+
# Copy app files
107
COPY . .
118

12-
EXPOSE 4000
9+
# Download build dependency
10+
RUN npm install react-scripts
1311

14-
CMD ["node", "app.js"]
12+
# Build the app
13+
RUN npm run build
14+
# ==== RUN =======
15+
# Set the env to "production"
16+
ENV NODE_ENV production
17+
# Expose the port on which the app will be running (3000 is the default that `serve` uses)
18+
EXPOSE 3000
19+
# Start the app
20+
CMD [ "npx", "serve", "build" ]

0 commit comments

Comments
 (0)