2023-11-29 10:34:51 +03:00
|
|
|
ARG NODE_VERSION="20.10"
|
2023-06-10 12:15:35 +03:00
|
|
|
ARG ALPINE_VERSION="3.18"
|
2022-09-06 14:51:38 +03:00
|
|
|
|
2023-03-28 22:27:29 +03:00
|
|
|
FROM node:${NODE_VERSION}-alpine${ALPINE_VERSION} AS node_base
|
2023-03-02 22:19:20 +03:00
|
|
|
|
|
|
|
FROM node_base AS builder_base
|
2022-12-15 17:18:25 +03:00
|
|
|
|
2024-01-08 09:48:14 +03:00
|
|
|
RUN apk add --no-cache python3 make g++
|
2023-03-02 22:19:20 +03:00
|
|
|
RUN npm install pnpm -g
|
2022-09-06 14:51:38 +03:00
|
|
|
|
2023-03-02 22:19:20 +03:00
|
|
|
# BUILDER
|
|
|
|
FROM builder_base AS builder
|
|
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
|
|
|
COPY ./pnpm-lock.yaml ./
|
2023-12-19 22:49:39 +03:00
|
|
|
RUN pnpm fetch
|
2023-03-02 22:19:20 +03:00
|
|
|
|
2023-12-19 22:49:39 +03:00
|
|
|
COPY ./pnpm-workspace.yaml ./
|
2023-03-02 22:19:20 +03:00
|
|
|
COPY ./package*.json ./
|
2023-08-28 21:39:02 +03:00
|
|
|
COPY ./packages/shared ./packages/shared
|
2023-03-02 22:19:20 +03:00
|
|
|
|
|
|
|
RUN pnpm install -r --prefer-offline
|
|
|
|
COPY ./src ./src
|
|
|
|
COPY ./tsconfig.json ./tsconfig.json
|
|
|
|
COPY ./next.config.mjs ./next.config.mjs
|
|
|
|
COPY ./public ./public
|
2023-06-28 23:44:56 +03:00
|
|
|
COPY ./tests ./tests
|
2022-09-06 14:51:38 +03:00
|
|
|
|
2023-12-08 17:48:49 +03:00
|
|
|
# Sentry
|
|
|
|
COPY ./sentry.client.config.ts ./sentry.client.config.ts
|
|
|
|
COPY ./sentry.edge.config.ts ./sentry.edge.config.ts
|
|
|
|
COPY ./sentry.server.config.ts ./sentry.server.config.ts
|
|
|
|
|
2023-12-08 19:06:54 +03:00
|
|
|
ARG SENTRY_AUTH_TOKEN
|
2023-12-10 21:28:52 +03:00
|
|
|
ARG SENTRY_DISABLE_AUTO_UPLOAD
|
2024-01-10 00:12:51 +03:00
|
|
|
ARG TIPI_VERSION
|
2023-12-10 21:28:52 +03:00
|
|
|
|
2023-12-08 19:06:54 +03:00
|
|
|
ENV SENTRY_AUTH_TOKEN=${SENTRY_AUTH_TOKEN}
|
2023-12-10 21:28:52 +03:00
|
|
|
ENV SENTRY_DISABLE_AUTO_UPLOAD=${SENTRY_DISABLE_AUTO_UPLOAD}
|
2024-01-10 00:12:51 +03:00
|
|
|
ENV TIPI_VERSION=${TIPI_VERSION}
|
2024-03-06 22:20:15 +03:00
|
|
|
ENV NEXT_SHARP_PATH=/app/node_modules/sharp
|
2023-12-08 19:06:54 +03:00
|
|
|
|
2023-12-19 22:49:39 +03:00
|
|
|
RUN pnpm build
|
2022-09-06 14:51:38 +03:00
|
|
|
|
2023-03-02 22:19:20 +03:00
|
|
|
# APP
|
|
|
|
FROM node_base AS app
|
|
|
|
|
2023-08-28 21:39:02 +03:00
|
|
|
ENV NODE_ENV production
|
2023-11-25 13:24:08 +03:00
|
|
|
|
2024-01-14 21:35:23 +03:00
|
|
|
USER 1000:1000
|
2022-06-03 23:42:23 +03:00
|
|
|
|
2023-03-02 22:19:20 +03:00
|
|
|
WORKDIR /app
|
2022-06-03 23:42:23 +03:00
|
|
|
|
2023-03-02 22:19:20 +03:00
|
|
|
COPY --from=builder /app/next.config.mjs ./
|
|
|
|
COPY --from=builder /app/public ./public
|
|
|
|
COPY --from=builder /app/package.json ./package.json
|
2024-01-14 21:35:23 +03:00
|
|
|
COPY --from=builder --chown=1000:1000 /app/.next/standalone ./
|
|
|
|
COPY --from=builder --chown=1000:1000 /app/.next/static ./.next/static
|
2022-10-08 00:35:48 +03:00
|
|
|
|
2023-03-02 22:19:20 +03:00
|
|
|
EXPOSE 3000
|
2022-06-03 23:42:23 +03:00
|
|
|
|
2023-03-02 22:19:20 +03:00
|
|
|
CMD ["npm", "run", "start"]
|