perf: add BuildKit npm cache mounts, add compose:down script
- RUN --mount=type=cache,target=/root/.npm for both npm install steps Persists npm cache across builds so unchanged deps aren't re-downloaded - deploy:staging now targets ae_app only (skip api/nginx rebuild) - compose:down includes --profile database to remove mariadb/pma containers and cleanly release ae_dev_net (fixes 'Resource is still in use' warning)
This commit is contained in:
@@ -6,7 +6,7 @@ WORKDIR /app
|
||||
# Install dependencies first for better Docker layer caching.
|
||||
# This step only reruns if package.json or package-lock.json changes.
|
||||
COPY package*.json ./
|
||||
RUN npm install
|
||||
RUN --mount=type=cache,target=/root/.npm npm install
|
||||
|
||||
# Copy the rest of the source code.
|
||||
COPY . .
|
||||
@@ -38,7 +38,7 @@ COPY --from=builder /app/build .
|
||||
COPY --from=builder /app/package.json .
|
||||
|
||||
# Install only production dependencies for a smaller, cleaner image.
|
||||
RUN npm install --omit=dev
|
||||
RUN --mount=type=cache,target=/root/.npm npm install --omit=dev
|
||||
|
||||
# Copy the resulting .env.production file to .env.
|
||||
# adapter-node reads from .env at runtime for non-PUBLIC_ variables.
|
||||
|
||||
@@ -17,8 +17,9 @@
|
||||
"format": "prettier --write .",
|
||||
"test:integration": "playwright test",
|
||||
"test:unit": "vitest",
|
||||
"deploy:staging": "docker compose -f ../aether_container_env/docker-compose.yml up -d --build --remove-orphans",
|
||||
"deploy:prod": "docker compose -f ../aether_container_env/docker-compose.yml build --build-arg BUILD_MODE=prod && docker compose -f ../aether_container_env/docker-compose.yml up -d --remove-orphans"
|
||||
"deploy:staging": "docker compose -f ../aether_container_env/docker-compose.yml up -d --build ae_app",
|
||||
"deploy:prod": "docker compose -f ../aether_container_env/docker-compose.yml build --build-arg BUILD_MODE=prod && docker compose -f ../aether_container_env/docker-compose.yml up -d --remove-orphans",
|
||||
"compose:down": "docker compose -f ../aether_container_env/docker-compose.yml --profile database down"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/js": "^9.39.1",
|
||||
|
||||
Reference in New Issue
Block a user