2024-03-07 20:45:00 +08:00
|
|
|
FROM node:20-bullseye as builder
|
2024-04-01 17:29:46 +08:00
|
|
|
ARG VERDACCIO_URL=https://npm.daoyoucloud.com/
|
|
|
|
|
|
|
|
ENV PNPM_HOME="/pnpm"
|
|
|
|
ENV PATH="$PNPM_HOME:$PATH"
|
|
|
|
RUN corepack enable
|
|
|
|
|
2022-10-24 00:31:24 +08:00
|
|
|
WORKDIR /app
|
2024-04-10 00:37:35 +08:00
|
|
|
RUN cd /app && npx --registry $VERDACCIO_URL create-nocobase-app@0.21.2-alpha.12 my-nocobase-app -a -e APP_ENV=production
|
2024-04-01 17:29:46 +08:00
|
|
|
RUN pnpm config set registry $VERDACCIO_URL
|
|
|
|
RUN --mount=type=cache,id=pnpm,target=/pnpm/store cd /app/my-nocobase-app && pnpm install --production
|
2022-10-24 00:31:24 +08:00
|
|
|
|
2023-07-25 18:07:17 +08:00
|
|
|
WORKDIR /app/my-nocobase-app
|
|
|
|
|
2022-10-24 00:31:24 +08:00
|
|
|
RUN cd /app \
|
|
|
|
&& rm -rf my-nocobase-app/packages/app/client/src/.umi \
|
|
|
|
&& rm -rf nocobase.tar.gz \
|
|
|
|
&& tar -zcf ./nocobase.tar.gz -C /app/my-nocobase-app .
|
2022-08-10 12:46:01 +08:00
|
|
|
|
2022-10-24 00:31:24 +08:00
|
|
|
|
2024-03-07 20:45:00 +08:00
|
|
|
FROM node:20-bullseye-slim
|
2022-10-24 00:31:24 +08:00
|
|
|
RUN apt-get update && apt-get install -y nginx
|
2022-08-10 12:46:01 +08:00
|
|
|
RUN rm -rf /etc/nginx/sites-enabled/default
|
2022-10-24 00:31:24 +08:00
|
|
|
COPY ./docker/nocobase/nocobase.conf /etc/nginx/sites-enabled/nocobase.conf
|
|
|
|
COPY --from=builder /app/nocobase.tar.gz /app/nocobase.tar.gz
|
2022-08-10 12:46:01 +08:00
|
|
|
|
2022-10-24 00:31:24 +08:00
|
|
|
WORKDIR /app/nocobase
|
|
|
|
|
2023-07-25 18:07:17 +08:00
|
|
|
RUN mkdir -p /app/nocobase/storage/uploads/ && echo "$COMMIT_HASH" >> /app/nocobase/storage/uploads/COMMIT_HASH
|
2022-11-16 12:53:58 +08:00
|
|
|
|
2022-10-24 00:31:24 +08:00
|
|
|
COPY ./docker/nocobase/docker-entrypoint.sh /app/
|
2022-08-10 12:46:01 +08:00
|
|
|
|
2024-04-01 17:29:46 +08:00
|
|
|
ENV PNPM_HOME="/pnpm"
|
|
|
|
ENV PATH="$PNPM_HOME:$PATH"
|
|
|
|
RUN corepack enable
|
|
|
|
RUN pnpm config set registry $VERDACCIO_URL
|
|
|
|
|
2022-08-10 12:46:01 +08:00
|
|
|
CMD ["/app/docker-entrypoint.sh"]
|