Refactor Dockerfile and GitHub Actions workflow for improved build performance. Removed caching for npm installs, disabled BuildKit in the workflow, and streamlined the Docker build command.

This commit is contained in:
smhk1376 committed 2026-09-24 15:11:37 +03:30
1 parent f585a5e35e
commit 648777c649
2 files changed
+4 -12

No files matched your search

+3 -7
View File
@@ -13,8 +13,8 @@ env:
NETWORK_NAME: shared_web_network
# Public hostname (Nginx Proxy Manager → this container:3000)
PUBLIC_HOST: aut.insaight.net
DOCKER_BUILDKIT: "1"
COMPOSE_DOCKER_CLI_BUILD: "1"
# Self-hosted runner has no docker-buildx; force classic builder
DOCKER_BUILDKIT: "0"
jobs:
deploy:
@@ -31,11 +31,7 @@ jobs:
|| docker network create "$NETWORK_NAME"
- name: Build image
run: |
docker build \
--progress=plain \
-t "$IMAGE_NAME" \
.
run: docker build -t "$IMAGE_NAME" .
- name: Restart container
env:
+1 -5
View File
@@ -1,11 +1,8 @@
# syntax=docker/dockerfile:1
# ---- Dependencies ----
FROM node:22-alpine AS deps
WORKDIR /app
COPY package.json package-lock.json ./
RUN --mount=type=cache,target=/root/.npm \
npm ci
RUN npm ci
# ---- Builder ----
FROM node:22-alpine AS builder
@@ -13,7 +10,6 @@ WORKDIR /app
ENV NEXT_TELEMETRY_DISABLED=1
# Skip React Compiler in image builds (big CPU/RAM cost on self-hosted runners)
ENV DISABLE_REACT_COMPILER=1
# Cap parallelism a bit so Turbopack/webpack don't thrash low-RAM hosts
ENV NODE_OPTIONS=--max-old-space-size=3072
COPY --from=deps /app/node_modules ./node_modules
COPY . .