Created
September 15, 2021 17:23
-
-
Save mdrobny/d674d3a84209ac86dca3ad3b5edd78e6 to your computer and use it in GitHub Desktop.
Revisions
-
mdrobny created this gist
Sep 15, 2021 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,31 @@ FROM node:14-alpine as builder WORKDIR /app COPY package*.json .npmrc ./ # installing deps is separate from copying source to reuse image with deps if none changed RUN npm ci COPY tsconfig*.json ./ COPY src ./src COPY config ./config # Compile TS to JS RUN npm run build # Remove devDependecies RUN npm prune --production # Move required files to final dir RUN mv package.json ./node_modules ./dist # resulting image FROM node:14-alpine WORKDIR /app COPY --from=builder /app/dist ./ EXPOSE 8080 CMD ["/usr/local/bin/npm", "start"]