mirror of
https://github.com/dmunozv04/iSponsorBlockTV.git
synced 2025-12-31 21:59:54 +03:00
Rework dockerfile and build for armv7
This commit is contained in:
2
.github/workflows/build_docker_images.yml
vendored
2
.github/workflows/build_docker_images.yml
vendored
@@ -67,7 +67,7 @@ jobs:
|
|||||||
uses: docker/build-push-action@v4
|
uses: docker/build-push-action@v4
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
platforms: linux/amd64, linux/arm64
|
platforms: linux/amd64, linux/arm64, linux/arm/v7
|
||||||
push: ${{ github.event_name != 'pull_request' }}
|
push: ${{ github.event_name != 'pull_request' }}
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
|
|||||||
26
Dockerfile
26
Dockerfile
@@ -1,5 +1,7 @@
|
|||||||
# syntax=docker/dockerfile:1
|
# syntax=docker/dockerfile:1
|
||||||
FROM python:3.11-alpine3.19 as compiler
|
FROM python:3.11-alpine3.19 as BASE
|
||||||
|
|
||||||
|
FROM base as compiler
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
@@ -8,18 +10,26 @@ COPY src .
|
|||||||
RUN python3 -m compileall -b -f . && \
|
RUN python3 -m compileall -b -f . && \
|
||||||
find . -name "*.py" -type f -delete
|
find . -name "*.py" -type f -delete
|
||||||
|
|
||||||
FROM python:3.11-alpine3.19
|
FROM base as DEP_INSTALLER
|
||||||
|
|
||||||
|
COPY requirements.txt .
|
||||||
|
|
||||||
|
RUN apk add --no-cache gcc musl-dev && \
|
||||||
|
pip install --upgrade pip wheel && \
|
||||||
|
pip install --user -r requirements.txt && \
|
||||||
|
pip uninstall -y pip wheel && \
|
||||||
|
apk del gcc musl-dev && \
|
||||||
|
python3 -m compileall -b -f /root/.local/lib/python3.11/site-packages && \
|
||||||
|
find /root/.local/lib/python3.11/site-packages -name "*.py" -type f -delete && \
|
||||||
|
find /root/.local/lib/python3.11/ -name "__pycache__" -type d -exec rm -rf {} +
|
||||||
|
|
||||||
|
FROM base
|
||||||
|
|
||||||
ENV PIP_NO_CACHE_DIR=off iSPBTV_docker=True iSPBTV_data_dir=data TERM=xterm-256color COLORTERM=truecolor
|
ENV PIP_NO_CACHE_DIR=off iSPBTV_docker=True iSPBTV_data_dir=data TERM=xterm-256color COLORTERM=truecolor
|
||||||
|
|
||||||
COPY requirements.txt .
|
COPY requirements.txt .
|
||||||
|
|
||||||
RUN pip install --upgrade pip wheel && \
|
COPY --from=dep_installer /root/.local /root/.local
|
||||||
pip install -r requirements.txt && \
|
|
||||||
pip uninstall -y pip wheel && \
|
|
||||||
python3 -m compileall -b -f /usr/local/lib/python3.11/site-packages && \
|
|
||||||
find /usr/local/lib/python3.11/site-packages -name "*.py" -type f -delete && \
|
|
||||||
find /usr/local/lib/python3.11/ -name "__pycache__" -type d -exec rm -rf {} +
|
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user