tiny-url-nestjs-microservice/Dockerfile

24 lines
568 B
Docker
Raw Normal View History

2024-01-21 12:56:22 +00:00
# Use an official Node runtime as a parent image
FROM node:16
# Set the working directory in the container
WORKDIR /usr/src/app
# Copy package.json and package-lock.json (or yarn.lock)
COPY package*.json ./
# Install dependencies
RUN npm install
# Bundle app source
COPY . .
# Build the application if needed
RUN npm run build
# Your app binds to port 3000 so you'll use the EXPOSE instruction to have it mapped by the docker daemon
EXPOSE 3000
# Define the command to run your app
CMD [ "node", "dist/main" ] # Adjust the path if your entry file is different