Skip to content

Commit

Permalink
fix(sitemap): fix issue with docker run (#549)
Browse files Browse the repository at this point in the history
  • Loading branch information
xdekoninck-pass authored Jan 30, 2025
1 parent fa13623 commit 4811eb7
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions content_management_system/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,36 +3,41 @@ FROM node:18.18-alpine3.18 AS builder

RUN mkdir /build
WORKDIR /build
COPY package.json yarn.lock /build/

RUN apk add git
COPY package.json yarn.lock /build/
RUN apk add git && yarn install --frozen-lockfile

RUN yarn install --frozen-lockfile
COPY src/plugins/sitemap-pass /build/src/plugins/sitemap-pass
WORKDIR /build/src/plugins/sitemap-pass
RUN yarn install --frozen-lockfile && yarn build

WORKDIR /build
COPY tsconfig.json /build/
COPY public /build/public
COPY config /build/config
COPY database /build/database
COPY types /build/types
COPY src /build/src

RUN cd src/plugins/sitemap-pass && yarn install --frozen-lockfile

RUN yarn build
RUN yarn build

# Runner
FROM node:18.18-alpine3.18 AS runner
ENV NODE_ENV=production

WORKDIR /app

COPY package.json /app/
COPY --from=builder /build/node_modules /app/node_modules
COPY --from=builder /build/dist /app
COPY public /app/public
COPY config /app/config
COPY database /app/database

COPY --from=builder /build/src/plugins/sitemap-pass/dist /app/src/plugins/sitemap-pass/
COPY --from=builder /build/src/plugins/sitemap-pass/package.json /app/src/plugins/sitemap-pass/package.json

RUN chown -R node:node /app/public

USER node

WORKDIR /app
CMD [ "yarn", "start" ]
CMD ["yarn", "start"]

0 comments on commit 4811eb7

Please sign in to comment.