add docker build steps
This commit is contained in:
22
web/dockerfile
Normal file
22
web/dockerfile
Normal file
@@ -0,0 +1,22 @@
|
||||
# Use an official Node runtime as a parent image
|
||||
FROM node:21-alpine
|
||||
|
||||
# Set the working directory in the container to /app
|
||||
WORKDIR /app
|
||||
|
||||
# Copy package.json and package-lock.json before other files
|
||||
# Utilise Docker cache to save re-installing dependencies if unchanged
|
||||
COPY package*.json ./
|
||||
|
||||
# Install dependencies
|
||||
RUN npm install
|
||||
|
||||
# Copy all files
|
||||
COPY . .
|
||||
|
||||
# Build the app
|
||||
RUN npm run build
|
||||
|
||||
# Serve the app on port 3000
|
||||
EXPOSE 3000
|
||||
CMD ["npm", "start"]
|
Reference in New Issue
Block a user