Skip to content

Instantly share code, notes, and snippets.

@jprivillaso
Created August 11, 2021 17:04
Show Gist options
  • Save jprivillaso/18a6d7eb3dd80c5ce449fd17babca821 to your computer and use it in GitHub Desktop.
Save jprivillaso/18a6d7eb3dd80c5ce449fd17babca821 to your computer and use it in GitHub Desktop.
Node/TS API Dockerfile
FROM node:14-alpine
# update packages
RUN apk update
# create root application folder
WORKDIR /app
# copy configs to /app folder
COPY package*.json ./
COPY config /app/config
COPY tsconfig.json ./
# copy source code to /app/src folder
COPY src /app/src
# check files list
RUN ls -a
RUN npm install
RUN npm run build
EXPOSE 3333
CMD [ "node", "./dist/index.js" ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment