add docker build steps

This commit is contained in:
azpsen
2024-01-31 13:40:22 -06:00
parent 1b44c585b0
commit e5ead23330
7 changed files with 278 additions and 0 deletions

22
web/dockerfile Normal file
View 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"]