Optimise Dokcerfile to only ship transpiled JS
This commit is contained in:
@@ -1,7 +1,11 @@
|
||||
FROM node:lts-alpine
|
||||
FROM node:lts-alpine AS build
|
||||
WORKDIR /app
|
||||
COPY . .
|
||||
RUN npm i
|
||||
RUN npm run build
|
||||
CMD ["node", "./dist/index.js"]
|
||||
|
||||
FROM node:lts-alpine AS runtime
|
||||
WORKDIR /app
|
||||
COPY --from=build /app/dist /app
|
||||
CMD ["node", "./index.js"]
|
||||
EXPOSE 3000
|
||||
|
||||
Reference in New Issue
Block a user