Last active
June 18, 2021 18:50
-
-
Save prateekkathal/294e6714e839498da581efaca717a234 to your computer and use it in GitHub Desktop.
For Medium Article - Using Docker with NestJS (or any NodeJS app)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM node:14.17.0-alpine | |
LABEL maintainer="dev@crowdlinker.com" | |
# Create app directory | |
WORKDIR /var/www/backend | |
# Install app dependencies - For NPM use: `COPY package.json package-lock.lock ./` | |
COPY package.json yarn.lock ./ | |
# For NPM use: `RUN npm ci` | |
RUN yarn --pure-lockfile | |
# Copy important files - Add ormconfig.ts here if using Typeorm | |
COPY .eslintrc.js nest-cli.json tsconfig.json tsconfig.build.json ./ | |
# Copy env | |
COPY .env.docker /var/www/backend/.env | |
# Add storage folder to the container (If you want to add other folder contents to the container) | |
# ADD storage /var/www/backend/storage | |
# Entrypoint command - Replace `"yarn"` with `"npm", "run"` if you are using NPM as your package manager. | |
# You can update this to run other NodeJS apps | |
CMD [ "yarn", "start:dev", "--preserveWatchOutput" ] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment