armv7 build working

This commit is contained in:
Donkie
2023-06-03 19:55:03 +02:00
parent 9a6572d197
commit 2ae4b88a14
3 changed files with 20 additions and 11 deletions

View File

@@ -1,2 +1,8 @@
client/dist client/dist
client/node_modules client/node_modules
*.egg-info
*.egg/
*.pyc
*.swp
__pycache__

View File

@@ -42,7 +42,7 @@ jobs:
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4 uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
with: with:
context: . context: .
platforms: linux/amd64,linux/arm64 platforms: linux/amd64,linux/arm64,linux/arm/v7
push: true push: true
tags: ${{ steps.meta.outputs.tags }} tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }} labels: ${{ steps.meta.outputs.labels }}

View File

@@ -7,17 +7,19 @@ RUN npm install
RUN echo "VITE_APIURL=/api/v1" > .env.production RUN echo "VITE_APIURL=/api/v1" > .env.production
RUN npm run build RUN npm run build
FROM python:3.11-alpine as python-builder FROM python:3.11-slim as python-builder
RUN apk update \ RUN --mount=target=/var/lib/apt/lists,type=cache,sharing=locked \
&& apk add \ --mount=target=/var/cache/apt,type=cache,sharing=locked \
build-base \ rm -f /etc/apt/apt.conf.d/docker-clean \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
python3-dev \ python3-dev \
gcc \ libpq-dev \
libc-dev g++
# Add local user so we don't run as root # Add local user so we don't run as root
RUN adduser -D app RUN useradd -m app
USER app USER app
RUN python -m venv /home/app/.venv RUN python -m venv /home/app/.venv
@@ -33,16 +35,17 @@ COPY --chown=app:app alembic.ini /home/app/spoolman/
COPY --chown=app:app README.md /home/app/spoolman/ COPY --chown=app:app README.md /home/app/spoolman/
WORKDIR /home/app/spoolman WORKDIR /home/app/spoolman
RUN pip install -e . RUN --mount=target=/home/app/.cache,type=cache,sharing=locked,uid=999,gid=1000 \
pip install -e .
FROM python:3.11-alpine as python-runner FROM python:3.11-slim as python-runner
LABEL org.opencontainers.image.source=https://github.com/Donkie/Spoolman LABEL org.opencontainers.image.source=https://github.com/Donkie/Spoolman
LABEL org.opencontainers.image.description="Keep track of your inventory of 3D-printer filament spools." LABEL org.opencontainers.image.description="Keep track of your inventory of 3D-printer filament spools."
LABEL org.opencontainers.image.licenses=MIT LABEL org.opencontainers.image.licenses=MIT
# Add local user so we don't run as root # Add local user so we don't run as root
RUN adduser -D app RUN useradd -m app
USER app USER app
# Copy built client # Copy built client