Skip to content

Commit

Permalink
feat: add native ARM64 support for the python image
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiolaverde0 committed Jun 28, 2024
1 parent 38d07b2 commit 400a3de
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/build-and-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ jobs:
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GCHR_LINGUA_PAT }}
password: ${{ secrets.GHCR_LINGUA_PAT }}

# https://github.com/docker/build-push-action
- name: Build and push PHP image to GitHub Container Registry
Expand All @@ -81,6 +81,7 @@ jobs:
# linux/386
platforms: |
linux/amd64
linux/arm64
# Note: tags have to be all lower-case
tags: ${{ steps.meta_php.outputs.tags }}
labels: ${{ steps.meta_php.outputs.labels }}
Expand All @@ -97,6 +98,7 @@ jobs:
file: "./docker/PythonDockerfile"
platforms: |
linux/amd64
linux/arm64
# Note: tags have to be all lower-case
tags: ${{ steps.meta_python.outputs.tags }}
labels: ${{ steps.meta_python.outputs.labels }}
Expand Down
17 changes: 16 additions & 1 deletion docker/PythonDockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@ FROM ubuntu:22.04

WORKDIR /app
RUN apt-get update -y \
&& apt-get install -y --no-install-recommends \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
build-essential \
curl \
gfortran \
liblapack-dev \
libopenblas-dev \
python3 \
pip \
tzdata \
Expand All @@ -13,7 +18,12 @@ RUN addgroup --gid 1000 laravel \
&& adduser --ingroup laravel --disabled-password --gecos "" --shell /bin/sh laravel
USER laravel

SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y
ENV PATH="/home/laravel/.cargo/bin:$PATH"

RUN pip install -U --no-cache-dir \
pip \
setuptools \
wheel \
lxml[html_clean] \
Expand All @@ -35,6 +45,11 @@ RUN pip install -U --no-cache-dir \
newspaper3k

RUN python3 -m spacy download de_core_news_sm \
&& python3 -m spacy download ja_core_news_sm \
&& python3 -m spacy download ko_core_news_sm \
&& python3 -m spacy download ru_core_news_sm \
&& python3 -m spacy download uk_core_news_sm \
&& python3 -m spacy download zh_core_web_sm \
&& python3 -m spacy download nb_core_news_sm \
&& python3 -m spacy download es_core_news_sm \
&& python3 -m spacy download nl_core_news_sm \
Expand Down

0 comments on commit 400a3de

Please sign in to comment.