18 أسطر
344 B
Docker
18 أسطر
344 B
Docker
# Use a lightweight Node base image
|
|
FROM node:18-alpine
|
|
|
|
# Set the working directory inside the container
|
|
WORKDIR /usr/src/app
|
|
|
|
# Copy dependency definitions and install them
|
|
COPY package*.json ./
|
|
RUN npm install --production
|
|
|
|
# Copy the application code
|
|
COPY . .
|
|
|
|
# Expose the API port
|
|
EXPOSE 3000
|
|
|
|
# Start the application
|
|
CMD ["npm", "start"] |