perf: optimize build speed with pip mirror and BuildKit
This commit is contained in:
@@ -58,7 +58,7 @@ jobs:
|
||||
- name: Build dev image
|
||||
run: |
|
||||
export DOCKER_API_VERSION=1.43
|
||||
DOCKER_BUILDKIT=0 docker build --cache-from nas-dashboard-dev:latest -t nas-dashboard-dev:latest dashboard/
|
||||
DOCKER_BUILDKIT=1 docker build --cache-from nas-dashboard-dev:latest -t nas-dashboard-dev:latest dashboard/
|
||||
- name: Sync runtime compose file
|
||||
run: cp dashboard/docker-compose.dev.yml /nas-dashboard/docker-compose.dev.yml
|
||||
- name: Deploy dev
|
||||
|
||||
@@ -56,7 +56,7 @@ jobs:
|
||||
prewarm_base_image "python:3.12-slim"
|
||||
|
||||
- name: Build
|
||||
run: DOCKER_BUILDKIT=0 docker build -t nas-dashboard:latest dashboard/
|
||||
run: DOCKER_BUILDKIT=1 docker build -t nas-dashboard:latest dashboard/
|
||||
- name: Sync runtime compose file
|
||||
run: cp dashboard/docker-compose.yml /nas-dashboard/docker-compose.yml
|
||||
- name: Deploy
|
||||
|
||||
@@ -11,7 +11,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends openssh-client
|
||||
RUN adduser --disabled-password --no-create-home --gecos "" app
|
||||
WORKDIR /app
|
||||
COPY backend/requirements.txt .
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
RUN pip install --no-cache-dir --index-url https://pypi.tuna.tsinghua.edu.cn/simple -r requirements.txt
|
||||
COPY backend/ ./
|
||||
COPY --from=frontend /build/dist /app/static
|
||||
RUN chown -R app:app /app
|
||||
|
||||
Reference in New Issue
Block a user