Some checks reported errors
continuous-integration/drone/push Build encountered an error
40 lines
1.1 KiB
Docker
40 lines
1.1 KiB
Docker
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 && \
|
|
apt-get install -y --no-install-recommends python3 g++ build-essential && \
|
|
rm -rf /var/lib/apt/lists/* && \
|
|
corepack enable
|
|
|
|
USER node
|
|
WORKDIR /app
|
|
ENV NODE_ENV=production
|
|
|
|
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 --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"]
|