-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
37 lines (26 loc) · 858 Bytes
/
Dockerfile
File metadata and controls
37 lines (26 loc) · 858 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
31
32
33
34
35
36
37
# Use an official node image as the base image
FROM node:20.15.1-alpine AS build
# Set the working directory
WORKDIR /app
# Copy the package.json and package-lock.json
COPY package*.json ./
# Install dependencies
RUN npm install
# Copy the rest of the application code
COPY . .
# Add chromium for unit testing
RUN apk add chromium
RUN apk add chromium-chromedriver
ENV CHROME_BIN=/usr/bin/chromium-browser
# Build the application
RUN npm run build:docker
# Use a lightweight web server to serve the built application
FROM nginx:stable-alpine
# Copy the built application from the previous stage
COPY --from=build /app/dist/browser /usr/share/nginx/html
# Copy the Nginx configuration
COPY nginx.conf /etc/nginx/conf.d/default.conf
# Expose port 80 to the outside world
EXPOSE 80
# Command to run the application
CMD ["nginx", "-g", "daemon off;"]