Skip to content

Instantly share code, notes, and snippets.

@stevenewey
Created November 27, 2022 17:54
Show Gist options
  • Save stevenewey/04a4eacaf52ba5071a486cbc7185b906 to your computer and use it in GitHub Desktop.
Save stevenewey/04a4eacaf52ba5071a486cbc7185b906 to your computer and use it in GitHub Desktop.
Workaround for LibreTranslate Docker Compose build on Arm64 (when pycld2 from pypi won't build)
diff --git a/Dockerfile b/Dockerfile
index aea119a..9c2b433 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -4,7 +4,7 @@ WORKDIR /app
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update -qq \
- && apt-get -qqq install --no-install-recommends -y libicu-dev pkg-config gcc g++ \
+ && apt-get -qqq install --no-install-recommends -y git libicu-dev pkg-config gcc g++ \
&& apt-get clean \
&& rm -rf /var/lib/apt
@@ -12,6 +12,9 @@ RUN apt-get update && apt-get upgrade --assume-yes
RUN python -mvenv venv && ./venv/bin/pip install --upgrade pip
+# install pycld2 manually direct from GH
+RUN ./venv/bin/pip install git+https://github.com/aboSamoor/pycld2.git
+
COPY . .
# Install package from source code
diff --git a/requirements.txt b/requirements.txt
index 39a300f..79ea06f 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -6,7 +6,6 @@ Flask-Limiter==2.6.3
waitress==2.1.2
expiringdict==1.2.2
pyicu>=2.8
-pycld2==0.41
morfessor==2.0.6
polyglot==16.7.4
appdirs==1.4.4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment