Skip to content

Commit

Permalink
Merge pull request #208 from DigiChanges/ci/add-new-docker-version
Browse files Browse the repository at this point in the history
ci: add new version
  • Loading branch information
Murzbul authored Feb 16, 2024
2 parents 6000561 + 0252862 commit dfb6a30
Showing 1 changed file with 6 additions and 16 deletions.
22 changes: 6 additions & 16 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
FROM node:20-alpine AS dev

RUN apk add dumb-init

RUN corepack enable && corepack install --global [email protected]
FROM digichanges/nexp:1.3 AS dev

WORKDIR /home/node

USER node

COPY --chown=node:node ["package.json", "pnpm-lock.yaml", ".husky", ".huskyrc", "/home/node/"]

RUN pnpm install
Expand All @@ -14,18 +12,12 @@ COPY --chown=node:node [".", "/home/node/"]

EXPOSE 8089

USER node

ENTRYPOINT ["dumb-init", "pnpm","dev"]

FROM dev AS build

USER node

RUN pnpm build

USER root

RUN rm -rf node_modules

FROM build AS prerelease
Expand All @@ -36,21 +28,19 @@ RUN pnpm install --production --ignore-scripts \
&& cd node_modules/bcrypt \
&& npm rebuild bcrypt --build-from-source

FROM node:20-alpine AS prod

RUN corepack enable && corepack install --global [email protected]
FROM digichanges/nexp:1.3 AS prod

ENV NODE_ENV production

WORKDIR /home/node

USER node

# Copy js files and change ownership to user node
COPY --from=prerelease /home/node/node_modules/ ./node_modules/
COPY --from=prerelease /home/node/dist/ ./dist/
COPY --from=prerelease /home/node/config/ ./config/
COPY --from=prerelease /home/node/package.json/ ./package.json
COPY --from=prerelease /home/node/pnpm-lock.yaml/ ./pnpm-lock.yaml

USER node

ENTRYPOINT ["dumb-init", "pnpm", "start"]

0 comments on commit dfb6a30

Please sign in to comment.