-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #208 from DigiChanges/ci/add-new-docker-version
ci: add new version
- Loading branch information
Showing
1 changed file
with
6 additions
and
16 deletions.
There are no files selected for viewing
This file contains 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 characters
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 | ||
|
@@ -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 | ||
|
@@ -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"] |