Dockerfile no longer builds client
This proved to be extremely slow on emulated hardware to build e.g. the linux/arm/v7 image. Since the built client is architecture agnostic, it's instead now built on the native hardware and inserted into the docker image.
This commit is contained in:
65
.github/workflows/ci.yml
vendored
65
.github/workflows/ci.yml
vendored
@@ -35,14 +35,53 @@ jobs:
|
|||||||
- name: Run pre-commit
|
- name: Run pre-commit
|
||||||
run: pre-commit run --all-files
|
run: pre-commit run --all-files
|
||||||
#
|
#
|
||||||
# Build native image for integration tests
|
# Build the Spoolman client for baking into the docker images
|
||||||
|
# This is done on native hardware to speed things up, vite is very slow on emulated hardware
|
||||||
#
|
#
|
||||||
build-amd64:
|
build-client:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Install node
|
||||||
|
uses: actions/setup-node@v3
|
||||||
|
with:
|
||||||
|
node-version: '20'
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
cd client
|
||||||
|
npm ci
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: |
|
||||||
|
cd client
|
||||||
|
rm -f .env && echo "VITE_APIURL=/api/v1" > .env.production
|
||||||
|
npm run build
|
||||||
|
npm run build.zip
|
||||||
|
|
||||||
|
- name: Upload artifact
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: client
|
||||||
|
path: client/dist
|
||||||
|
#
|
||||||
|
# Build native image for integration tests
|
||||||
|
#
|
||||||
|
build-amd64:
|
||||||
|
needs: [build-client]
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Download client
|
||||||
|
uses: actions/download-artifact@v3
|
||||||
|
with:
|
||||||
|
name: client
|
||||||
|
path: client/dist
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v2
|
uses: docker/setup-buildx-action@v2
|
||||||
|
|
||||||
@@ -158,11 +197,18 @@ jobs:
|
|||||||
#
|
#
|
||||||
build-arm64:
|
build-arm64:
|
||||||
if: ${{ github.event_name != 'pull_request' }}
|
if: ${{ github.event_name != 'pull_request' }}
|
||||||
|
needs: [build-client]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Download client
|
||||||
|
uses: actions/download-artifact@v3
|
||||||
|
with:
|
||||||
|
name: client
|
||||||
|
path: client/dist
|
||||||
|
|
||||||
- name: Set up QEMU
|
- name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v2
|
uses: docker/setup-qemu-action@v2
|
||||||
|
|
||||||
@@ -190,11 +236,18 @@ jobs:
|
|||||||
#
|
#
|
||||||
build-armv7:
|
build-armv7:
|
||||||
if: ${{ github.event_name != 'pull_request' }}
|
if: ${{ github.event_name != 'pull_request' }}
|
||||||
|
needs: [build-client]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Download client
|
||||||
|
uses: actions/download-artifact@v3
|
||||||
|
with:
|
||||||
|
name: client
|
||||||
|
path: client/dist
|
||||||
|
|
||||||
- name: Set up QEMU
|
- name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v2
|
uses: docker/setup-qemu-action@v2
|
||||||
|
|
||||||
@@ -221,12 +274,18 @@ jobs:
|
|||||||
#
|
#
|
||||||
release:
|
release:
|
||||||
if: ${{ github.event_name != 'pull_request' }}
|
if: ${{ github.event_name != 'pull_request' }}
|
||||||
needs: [test, build-amd64, build-arm64, build-armv7, style]
|
needs: [test, build-amd64, build-arm64, build-armv7, style, build-client]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Download client
|
||||||
|
uses: actions/download-artifact@v3
|
||||||
|
with:
|
||||||
|
name: client
|
||||||
|
path: client/dist
|
||||||
|
|
||||||
- name: Set up QEMU
|
- name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v2
|
uses: docker/setup-qemu-action@v2
|
||||||
|
|
||||||
|
|||||||
11
Dockerfile
11
Dockerfile
@@ -1,12 +1,3 @@
|
|||||||
FROM node:20-alpine as client-builder
|
|
||||||
|
|
||||||
COPY ./client /client
|
|
||||||
WORKDIR /client
|
|
||||||
RUN npm ci
|
|
||||||
|
|
||||||
RUN rm -f .env && echo "VITE_APIURL=/api/v1" > .env.production
|
|
||||||
RUN npm run build
|
|
||||||
|
|
||||||
FROM python:3.11-alpine as python-builder
|
FROM python:3.11-alpine as python-builder
|
||||||
|
|
||||||
RUN apk add --no-cache g++ python3-dev libpq-dev libstdc++
|
RUN apk add --no-cache g++ python3-dev libpq-dev libstdc++
|
||||||
@@ -49,7 +40,7 @@ RUN adduser -D app \
|
|||||||
USER app
|
USER app
|
||||||
|
|
||||||
# Copy built client
|
# Copy built client
|
||||||
COPY --chown=app:app --from=client-builder /client/dist /home/app/spoolman/client/dist
|
COPY --chown=app:app ./client/dist /home/app/spoolman/client/dist
|
||||||
|
|
||||||
# Copy built app
|
# Copy built app
|
||||||
COPY --chown=app:app --from=python-builder /home/app/spoolman /home/app/spoolman
|
COPY --chown=app:app --from=python-builder /home/app/spoolman /home/app/spoolman
|
||||||
|
|||||||
Reference in New Issue
Block a user