Slimmed down docker build thx to copy
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
c21076a049
commit
10c68cfb37
14
Dockerfile
14
Dockerfile
|
@ -1,12 +1,15 @@
|
|||
# Typescript Build
|
||||
FROM registry.odit.services/hub/library/node:19.0.1-alpine3.16
|
||||
FROM registry.odit.services/hub/library/node:19.0.1-alpine3.16 AS build
|
||||
WORKDIR /app
|
||||
COPY package.json ./
|
||||
RUN npm i -g pnpm
|
||||
RUN pnpm i
|
||||
COPY tsconfig.json ./
|
||||
COPY src ./src
|
||||
RUN pnpm run build
|
||||
RUN pnpm run build \
|
||||
&& rm -rf /app/node_modules \
|
||||
&& pnpm i --production --prefer-offline
|
||||
|
||||
# final image
|
||||
FROM registry.odit.services/hub/library/alpine:3.16
|
||||
WORKDIR /app
|
||||
|
@ -19,7 +22,6 @@ RUN apk add --no-cache \
|
|||
ca-certificates \
|
||||
ttf-freefont \
|
||||
nodejs \
|
||||
yarn \
|
||||
font-noto-emoji \
|
||||
&& apk add wqy-zenhei --update-cache --repository https://nl.alpinelinux.org/alpine/edge/testing
|
||||
|
||||
|
@ -35,7 +37,7 @@ RUN addgroup -S pptruser && adduser -S -g pptruser pptruser \
|
|||
# Run everything after as non-privileged user.
|
||||
USER pptruser
|
||||
|
||||
COPY package.json ./
|
||||
RUN yarn
|
||||
COPY --from=0 /app/dist app
|
||||
COPY --from=build /app/package.json /app/
|
||||
COPY --from=build /app/node_modules /app/node_modules
|
||||
COPY --from=build /app/dist app
|
||||
ENTRYPOINT ["node", "app/app.js"]
|
Loading…
Reference in New Issue