Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/cypress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:
- 'cypress.config.ts'
- 'package.json'
- 'pnpm-lock.yaml'
- 'next.config.ts'
- 'next.config.mjs'
- 'tsconfig.json'
- '.github/workflows/cypress.yml'
push:
Expand All @@ -26,7 +26,7 @@ on:
- 'cypress.config.ts'
- 'package.json'
- 'pnpm-lock.yaml'
- 'next.config.ts'
- 'next.config.mjs'
- 'tsconfig.json'
- '.github/workflows/cypress.yml'

Expand Down
38 changes: 21 additions & 17 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,6 @@ RUN --mount=type=cache,id=pnpm,target=/pnpm/store CI=true pnpm install --prod --
# Remove large native modules for linux-x64-gnu platform (we use alpine which is musl-based)
# not supported in pnpm for now due to this bug: https://github.com/pnpm/pnpm/issues/9654
RUN du -shL ./node_modules/.pnpm/* | grep '[0-9]M.*' | grep 'linux-x64-gnu@' | awk '{print $2}' | xargs rm -rf
# Remove large module files not needed for production
RUN if [ -d node_modules/.pnpm ]; then \
find node_modules/.pnpm -type d \( \
-path "*ace-builds/src-noconflict" -o \
-path "*ace-builds/src" -o \
-path "*ace-builds/src-min" -o \
-path "*country-flag-icons/react" -o \
-path "*country-flag-icons/string" -o \
-path "*country-flag-icons/1x1" -o \
-path "*@heroicons/react/16" \
\) -exec rm -rf {} + || true; \
fi

FROM base AS build

Expand All @@ -48,8 +36,6 @@ RUN --mount=type=cache,id=pnpm,target=/pnpm/store CYPRESS_INSTALL_BINARY=0 pnpm

RUN pnpm build

RUN rm -rf .next/cache

FROM node:22.23.4-alpine3.23@sha256:206878a60dc7014193f418ab9259b6110c15fbd514b3044a267be706509944e4
ARG SOURCE_DATE_EPOCH
ARG COMMIT_TAG
Expand All @@ -62,9 +48,27 @@ USER node:node

WORKDIR /app

COPY --chown=node:node . .
COPY --chown=node:node --from=prod-deps /app/node_modules ./node_modules
COPY --chown=node:node --from=build /app/.next ./.next
COPY --chown=node:node --exclude=src --exclude=server . .
# @next/swc is only for next build and for next.config.ts
# ts-node, @swc/core, and typescript are only needed for build-time type checking and compilation
# ace-builds, country-flag-icons and @heroicons subfolders are large module files not needed for production
# Source map files are not needed for production
# Remove large module files not needed for production
COPY --chown=node:node --from=prod-deps \
--exclude=.pnpm/@next+swc-* \
Comment thread
M0NsTeRRR marked this conversation as resolved.
Resolved
--exclude=.pnpm/@swc+core* \
--exclude=.pnpm/ts-node@* \
--exclude=.pnpm/typescript@* \
--exclude=**/ace-builds/src-noconflict \
--exclude=**/ace-builds/src \
--exclude=**/ace-builds/src-min \
--exclude=**/country-flag-icons/react \
--exclude=**/country-flag-icons/string \
--exclude=**/country-flag-icons/1x1 \
--exclude=**/@heroicons/react/16 \
--exclude=**/*.map \
/app/node_modules ./node_modules
COPY --chown=node:node --from=build --exclude=cache --exclude=**/*.map /app/.next ./.next
COPY --chown=node:node --from=build /app/dist ./dist
Comment thread
M0NsTeRRR marked this conversation as resolved.
Resolved

RUN touch config/DOCKER && \
Expand Down
7 changes: 4 additions & 3 deletions next.config.ts → next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { NextConfig } from 'next';

const nextConfig: NextConfig = {
/**
* @type {import('next').NextConfig}
*/
const nextConfig = {
env: {
commitTag: process.env.COMMIT_TAG || 'local',
unsafeDoNotUseDemo: process.env.UNSAFE_DO_NOT_USE_DEMO,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
"@react-spring/web": "^10.0.3",
"@seerr-team/react-tailwindcss-datepicker": "^1.3.4",
"@supercharge/request-ip": "1.2.0",
"@svgr/webpack": "8.1.0",
"@tanem/react-nprogress": "6.0.3",
"ace-builds": "1.43.6",
"axios": "1.21.0",
Expand Down Expand Up @@ -117,6 +116,7 @@
"@commitlint/config-conventional": "20.5.0",
"@eslint/js": "9.39.3",
"@next/eslint-plugin-next": "16.4.2",
"@svgr/webpack": "8.1.0",
"@tailwindcss/aspect-ratio": "^0.4.2",
"@tailwindcss/forms": "^0.5.11",
"@tailwindcss/typography": "^0.5.19",
Expand Down
6 changes: 3 additions & 3 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading