From a9ed9150685ceda2ed1d6e3fcf9e978ced37fb71 Mon Sep 17 00:00:00 2001 From: WhiteX Date: Sat, 14 Jun 2025 10:35:23 +0300 Subject: [PATCH] feat: streamline Dockerfile by consolidating app file copies and removing unnecessary environment files --- Dockerfile_coolify | 26 ++++---------------------- 1 file changed, 4 insertions(+), 22 deletions(-) diff --git a/Dockerfile_coolify b/Dockerfile_coolify index 5116dcf5..736e1e78 100644 --- a/Dockerfile_coolify +++ b/Dockerfile_coolify @@ -18,7 +18,10 @@ FROM base AS builder WORKDIR /app/web # Install dependencies based on the preferred package manager -COPY ./apps/web/package.json ./apps/web/pnpm-lock.yaml* ./apps/web/.npmrc* ./ +COPY ./apps/web/package.json ./apps/web/pnpm-lock.yaml* ./ +COPY ./apps/web /app/web +# Remove any environment files that might interfere +RUN rm -f .env* # Omit --production flag for TypeScript devDependencies RUN \ if [ -f pnpm-lock.yaml ]; then corepack enable pnpm && pnpm i --frozen-lockfile; \ @@ -26,27 +29,6 @@ RUN \ else echo "Warning: Lockfile not found. It is recommended to commit lockfiles to version control." && npm install; \ fi -COPY ./apps/web/app ./app -COPY ./apps/web/components ./components -COPY ./apps/web/hooks ./hooks -COPY ./apps/web/lib ./lib -COPY ./apps/web/pages ./pages -COPY ./apps/web/public ./public -COPY ./apps/web/services ./services -COPY ./apps/web/styles ./styles -COPY ./apps/web/types ./types -COPY ./apps/web/utils ./utils -COPY ./apps/web/next.config.js . -COPY ./apps/web/tsconfig.json . -COPY ./apps/web/tailwind.config.js . -COPY ./apps/web/postcss.config.js . -COPY ./apps/web/components.json . -COPY ./apps/web/middleware.ts . -COPY ./apps/web/instrumentation.ts . - -# Remove any environment files that might interfere -RUN rm -f .env* - # Environment variables must be present at build time ARG NEXT_PUBLIC_LEARNHOUSE_API_URL ARG NEXT_PUBLIC_LEARNHOUSE_BACKEND_URL