ソースを参照

Split docker files and requirements.

scossu 1 年間 前
コミット
2dda4ee92e
5 ファイル変更41 行追加25 行削除
  1. 5 19
      Dockerfile
  2. 7 0
      deps.txt
  3. 1 6
      requirements.txt
  4. 21 0
      scriptshifter_base.Dockerfile
  5. 7 0
      test.Dockerfile

+ 5 - 19
Dockerfile

@@ -1,29 +1,15 @@
-FROM python:3.10-slim-bookworm
+FROM lcnetdev/scriptshifter_base:latest
+ARG WORKROOT "/usr/local/scriptshifter/src"
 
-RUN apt update
-RUN apt install -y build-essential tzdata gfortran libopenblas-dev libboost-all-dev libpcre2-dev
-
-ENV TZ=America/New_York
-ENV _workroot "/usr/local/scriptshifter/src"
-
-RUN addgroup --system www
-RUN adduser --system www
-RUN gpasswd -a www www
-
-WORKDIR ${_workroot}
+# Copy core application files.
+WORKDIR ${WORKROOT}
 COPY entrypoint.sh uwsgi.ini wsgi.py ./
-COPY ext ./ext/
 COPY scriptshifter ./scriptshifter/
-
 COPY requirements.txt ./
 RUN pip install --no-cache-dir -r requirements.txt
 
-# Remove development packages.
-RUN apt remove -y build-essential git
-RUN apt autoremove -y
-
 RUN chmod +x ./entrypoint.sh
-RUN chown -R www:www ${_workroot} .
+#RUN chown -R www:www ${WORKROOT} .
 
 EXPOSE 8000
 

+ 7 - 0
deps.txt

@@ -0,0 +1,7 @@
+# External dependencies.
+aksharamukha>=2.1,<3
+camel-tools>=1.5
+funcy>=1.15,<2
+pymarc>=4.0,<5
+repackage>=0.7.3
+./ext/yiddish

+ 1 - 6
requirements.txt

@@ -1,10 +1,5 @@
-aksharamukha>=2.1,<3
-camel-tools>=1.5
+# Core application dependencies.
 flask>=2.3,<3
-funcy>=1.15,<2
-pymarc>=4.0,<5
 python-dotenv>=1.0,<2
 pyyaml>=6.0,<7
-repackage>=0.7.3
 uwsgi>=2.0,<2.1
-./ext/yiddish

+ 21 - 0
scriptshifter_base.Dockerfile

@@ -0,0 +1,21 @@
+FROM python:3.10-slim-bookworm
+
+RUN apt update
+RUN apt install -y build-essential tzdata gfortran libopenblas-dev libboost-all-dev libpcre2-dev
+
+ENV TZ=America/New_York
+ARG WORKROOT "/usr/local/scriptshifter/src"
+
+RUN addgroup --system www
+RUN adduser --system www
+RUN gpasswd -a www www
+
+# Copy external dependencies.
+WORKDIR ${WORKROOT}
+COPY ext ./ext/
+COPY deps.txt ./
+RUN pip install --no-cache-dir -r deps.txt
+
+# Remove development packages.
+RUN apt remove -y build-essential git
+RUN apt autoremove -y

+ 7 - 0
test.Dockerfile

@@ -0,0 +1,7 @@
+FROM python:3.10-slim-bookworm
+
+RUN apt update
+RUN apt install -y build-essential libpcre2-dev
+
+RUN pip install uwsgi
+