node-ui / Dockerfile
srijan9994's picture
docker modify for env
1e99658
raw
history blame contribute delete
617 Bytes
# Use an official Node.js runtime as a parent image
FROM node:14
# Set the working directory in the container
WORKDIR /node-ui
# Copy the package.json and package-lock.json to the working directory
COPY package*.json ./
# Install the dependencies
RUN npm install
# Copy the rest of the application code to the working directory
COPY . .
# Build the React application
RUN node create-env.js && npm run build
# Serve the built React application using a simple HTTP server
RUN npm install -g serve
# Expose port 3000 to the outside world
EXPOSE 7860
# Start the server
CMD ["serve", "-s", "build", "-l", "7860"]