Files
managing-apps/src/Managing.WebApp/Dockerfile-web-ui-dev

38 lines
971 B
Plaintext

# Use an official Node.js image as the base
FROM node:18-alpine
# Set the working directory in the container
WORKDIR /app
# Set environment variable to skip Chromium download
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
# Install git and Python
RUN apk update && apk add --no-cache git python3 make g++
# Create a symlink for python3 as python
RUN ln -sf /usr/bin/python3 /usr/bin/python
# Copy package.json and package-lock.json to the container
COPY package*.json ./
# Install dependencies with the --legacy-peer-deps flag to bypass peer dependency conflicts
RUN npm install --legacy-peer-deps
# Copy the rest of the app's source code to the container
COPY . .
# Build the app
RUN npm run build
# Use NGINX as the web server
FROM nginx:alpine
# Copy the built app to the NGINX web server directory
COPY --from=0 /app/build /usr/share/nginx/html
# Expose port 80 for the NGINX web server
EXPOSE 80
# Start the NGINX web server
CMD ["nginx", "-g", "daemon off;"]