lisätty Dockerfile
This commit is contained in:
23
Dockerfile
Normal file
23
Dockerfile
Normal file
@@ -0,0 +1,23 @@
|
||||
# Use an official Node.js runtime as the base image
|
||||
FROM node:20-alpine
|
||||
|
||||
# Set the working directory in the container
|
||||
WORKDIR /app
|
||||
|
||||
# Copy the package.json and package-lock.json files to the container
|
||||
COPY package.json package-lock.json ./
|
||||
|
||||
# Install project dependencies
|
||||
RUN npm install
|
||||
|
||||
# Copy the rest of the project files to the container
|
||||
COPY . .
|
||||
|
||||
# Build the React app
|
||||
RUN npm run build
|
||||
|
||||
# Expose the port that the server will listen on
|
||||
EXPOSE 5173
|
||||
|
||||
# Start the application
|
||||
CMD [ "npm", "run", "preview" ]
|
||||
Reference in New Issue
Block a user