20 lines
457 B
Docker
20 lines
457 B
Docker
# Use an official Node.js runtime as a parent image
|
|
FROM node:18-alpine
|
|
|
|
# Set the working directory inside the container
|
|
WORKDIR /usr/src/app
|
|
|
|
# Copy package.json and package-lock.json to the working directory
|
|
COPY package*.json ./
|
|
|
|
# Install any needed packages
|
|
RUN npm install --production
|
|
|
|
# Copy the rest of the application code to the container
|
|
COPY . .
|
|
|
|
# Expose the port the app runs on
|
|
EXPOSE 3000
|
|
|
|
# Start the application
|
|
CMD ["node", "server.js"] |