Include full build in Dockerfile
Some checks reported errors
continuous-integration/drone/push Build encountered an error
Some checks reported errors
continuous-integration/drone/push Build encountered an error
This commit is contained in:
@@ -1,3 +1,18 @@
|
||||
FROM node:18-bookworm-slim AS build
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get install -y --no-install-recommends python3 g++ build-essential && \
|
||||
corepack enable
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY --chown=node:node . .
|
||||
|
||||
RUN yarn install --immutable
|
||||
RUN yarn tsc
|
||||
RUN yarn build:backend
|
||||
RUN yarn build
|
||||
|
||||
FROM node:18-bookworm-slim
|
||||
|
||||
RUN apt-get update && \
|
||||
@@ -6,19 +21,19 @@ RUN apt-get update && \
|
||||
corepack enable
|
||||
|
||||
USER node
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
ENV NODE_ENV=production
|
||||
|
||||
COPY --chown=node:node yarn.lock package.json .yarnrc.yml ./
|
||||
COPY --chown=node:node .yarn .yarn
|
||||
COPY --chown=node:node packages/backend/dist/skeleton.tar.gz ./
|
||||
COPY --from=build --chown=node:node /app/yarn.lock /app/package.json /app/.yarnrc.yml ./
|
||||
COPY --from=build --chown=node:node /app/.yarn .yarn
|
||||
COPY --from=build --chown=node:node /app/packages/backend/dist/skeleton.tar.gz ./
|
||||
RUN tar xzf skeleton.tar.gz && rm skeleton.tar.gz
|
||||
|
||||
RUN yarn workspaces focus --all --production
|
||||
|
||||
COPY --chown=node:node packages/backend/dist/bundle.tar.gz app-config*.yaml ./
|
||||
COPY --from=build --chown=node:node /app/packages/backend/dist/bundle.tar.gz ./
|
||||
RUN tar xzf bundle.tar.gz && rm bundle.tar.gz
|
||||
|
||||
COPY --from=build --chown=node:node /app/app-config*.yaml ./
|
||||
|
||||
CMD ["node", "packages/backend", "--config", "app-config.yaml", "--config", "app-config.production.yaml"]
|
||||
|
||||
Reference in New Issue
Block a user