forked from gitea_admin/simple-node
21 lines
393 B
Docker
21 lines
393 B
Docker
# Use Node.js LTS as the base image
|
|
FROM node:18-slim
|
|
|
|
# Create and change to the app directory
|
|
WORKDIR /usr/src/app
|
|
|
|
# Copy package.json and package-lock.json
|
|
COPY package*.json ./
|
|
|
|
# Install dependencies
|
|
RUN npm install --production
|
|
|
|
# Copy the rest of the application code
|
|
COPY . .
|
|
|
|
# Expose the port the app runs on
|
|
EXPOSE 3001
|
|
|
|
# Command to run the application
|
|
CMD [ "node", "index.js" ]
|