diff options
| author | Fuwn <[email protected]> | 2023-07-24 22:47:14 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2023-07-24 22:47:14 -0700 |
| commit | 5846c0ea72df7012e3d0d07ace9c319b7a5caa23 (patch) | |
| tree | 44d881981dc8af6daa8018341d595d82c70f1c8e | |
| parent | fix(html): replace icon (diff) | |
| download | old.due.moe-5846c0ea72df7012e3d0d07ace9c319b7a5caa23.tar.xz old.due.moe-5846c0ea72df7012e3d0d07ace9c319b7a5caa23.zip | |
ci(docker): docker support
| -rw-r--r-- | .dockerignore | 13 | ||||
| -rw-r--r-- | Dockerfile | 22 |
2 files changed, 35 insertions, 0 deletions
diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..438992a --- /dev/null +++ b/.dockerignore @@ -0,0 +1,13 @@ +# Python +__pycache__/ +*.py[oc] +build/ +dist/ +wheels/ +*.egg-info + +# venv +.venv + +# Development +.env 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"] |