aboutsummaryrefslogtreecommitdiff
path: root/Dockerfile
diff options
context:
space:
mode:
authorFuwn <[email protected]>2023-07-24 22:47:14 -0700
committerFuwn <[email protected]>2023-07-24 22:47:14 -0700
commit5846c0ea72df7012e3d0d07ace9c319b7a5caa23 (patch)
tree44d881981dc8af6daa8018341d595d82c70f1c8e /Dockerfile
parentfix(html): replace icon (diff)
downloadold.due.moe-5846c0ea72df7012e3d0d07ace9c319b7a5caa23.tar.xz
old.due.moe-5846c0ea72df7012e3d0d07ace9c319b7a5caa23.zip
ci(docker): docker support
Diffstat (limited to 'Dockerfile')
-rw-r--r--Dockerfile22
1 files changed, 22 insertions, 0 deletions
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 0000000..0ed368d
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,22 @@
+FROM python:3.11-alpine
+
+WORKDIR /due
+
+COPY requirements.lock /due
+COPY pyproject.toml /due
+COPY src/ /due/src
+
+RUN python -m pip install --no-cache-dir --upgrade pip
+
+RUN sed '/-e/d' requirements.lock > requirements.txt
+RUN sed -i 's/requires = \["hatchling"\]/requires = \["setuptools", "setuptools-scm"\]/; s/build-backend = "hatchling.build"/build-backend = "setuptools.build_meta"/' pyproject.toml
+RUN sed -i '/\[tool\.hatch\.metadata\]/d; /allow-direct-references = true/d' pyproject.toml
+
+RUN pip install --upgrade setuptools
+RUN pip install -r requirements.txt
+
+RUN pip install .
+
+EXPOSE 5000
+
+CMD ["python", "-m", "flask", "--app", "due", "run", "--host=0.0.0.0"]