mirror of
https://github.com/tiennm99/coolify.git
synced 2026-04-17 17:21:04 +00:00
fix: optimize caching in Dockerfile and GitHub Actions workflow
This commit is contained in:
6
.github/workflows/coolify-staging-build.yml
vendored
6
.github/workflows/coolify-staging-build.yml
vendored
@@ -74,8 +74,10 @@ jobs:
|
|||||||
tags: |
|
tags: |
|
||||||
${{ env.DOCKER_REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.sanitize.outputs.tag }}-${{ matrix.arch }}
|
${{ env.DOCKER_REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.sanitize.outputs.tag }}-${{ matrix.arch }}
|
||||||
${{ env.GITHUB_REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.sanitize.outputs.tag }}-${{ matrix.arch }}
|
${{ env.GITHUB_REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.sanitize.outputs.tag }}-${{ matrix.arch }}
|
||||||
cache-from: type=gha
|
cache-from: |
|
||||||
cache-to: type=gha,mode=max
|
type=gha,scope=build-${{ matrix.arch }}
|
||||||
|
type=registry,ref=${{ env.GITHUB_REGISTRY }}/${{ env.IMAGE_NAME }}:buildcache-${{ matrix.arch }}
|
||||||
|
cache-to: type=gha,mode=max,scope=build-${{ matrix.arch }}
|
||||||
|
|
||||||
merge-manifest:
|
merge-manifest:
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
|
|||||||
@@ -27,7 +27,8 @@ RUN docker-php-serversideup-set-id www-data $USER_ID:$GROUP_ID && \
|
|||||||
|
|
||||||
WORKDIR /var/www/html
|
WORKDIR /var/www/html
|
||||||
COPY --chown=www-data:www-data composer.json composer.lock ./
|
COPY --chown=www-data:www-data composer.json composer.lock ./
|
||||||
RUN composer install --no-dev --no-interaction --no-plugins --no-scripts --prefer-dist
|
RUN --mount=type=cache,target=/tmp/cache \
|
||||||
|
COMPOSER_CACHE_DIR=/tmp/cache composer install --no-dev --no-interaction --no-plugins --no-scripts --prefer-dist
|
||||||
|
|
||||||
USER www-data
|
USER www-data
|
||||||
|
|
||||||
@@ -38,7 +39,8 @@ FROM node:24-alpine AS static-assets
|
|||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY package*.json vite.config.js postcss.config.cjs ./
|
COPY package*.json vite.config.js postcss.config.cjs ./
|
||||||
RUN npm ci
|
RUN --mount=type=cache,target=/root/.npm \
|
||||||
|
npm ci
|
||||||
COPY . .
|
COPY . .
|
||||||
RUN npm run build
|
RUN npm run build
|
||||||
|
|
||||||
@@ -72,8 +74,9 @@ RUN apk add --no-cache gnupg && \
|
|||||||
curl -fSsL https://www.postgresql.org/media/keys/ACCC4CF8.asc | gpg --dearmor > /usr/share/keyrings/postgresql.gpg
|
curl -fSsL https://www.postgresql.org/media/keys/ACCC4CF8.asc | gpg --dearmor > /usr/share/keyrings/postgresql.gpg
|
||||||
|
|
||||||
# Install system dependencies
|
# Install system dependencies
|
||||||
RUN apk upgrade
|
RUN --mount=type=cache,target=/var/cache/apk \
|
||||||
RUN apk add --no-cache \
|
apk upgrade && \
|
||||||
|
apk add --no-cache \
|
||||||
postgresql${POSTGRES_VERSION}-client \
|
postgresql${POSTGRES_VERSION}-client \
|
||||||
openssh-client \
|
openssh-client \
|
||||||
git \
|
git \
|
||||||
|
|||||||
Reference in New Issue
Block a user