forked from NJIT-WIS/mywebclass-simulation-intermediate
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
30 lines (21 loc) · 802 Bytes
/
Dockerfile
File metadata and controls
30 lines (21 loc) · 802 Bytes
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
# syntax=docker/dockerfile:1.3
# Use a multiarch Node.js runtime as a parent image
FROM --platform=$BUILDPLATFORM node:latest AS builder
# Set the working directory to /app
WORKDIR /app
# Copy the package.json and package-lock.json files to the container
COPY package*.json ./
# Install dependencies
RUN npm install
# Copy the rest of the application code to the container
COPY . .
# Build the webpack site and output it to the docs directory
RUN npm run build
# Use a multiarch Nginx runtime as a parent image
FROM --platform=$TARGETPLATFORM nginx:latest
# Copy the output of the webpack build from the builder stage to the nginx image
COPY --from=builder /app/docs /usr/share/nginx/html
# Expose port 80 for HTTP traffic
EXPOSE 80
# Start the nginx server
CMD ["nginx", "-g", "daemon off;"]