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 114d69c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
3 changes: 2 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 Down
15 changes: 15 additions & 0 deletions docker/PythonDockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ FROM ubuntu:22.04
WORKDIR /app
RUN apt-get update -y \
&& 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 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 114d69c

Please sign in to comment.