aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFuwn <[email protected]>2023-07-29 18:00:39 -0700
committerFuwn <[email protected]>2023-07-29 18:00:39 -0700
commit58612e8dbd620c6824f2c6b5db9c7819e088db15 (patch)
tree6413006d092ddb8312d79f59398f7a11f3d3b57f
parentfeat(index): hide missing by default (diff)
downloadold.due.moe-58612e8dbd620c6824f2c6b5db9c7819e088db15.tar.xz
old.due.moe-58612e8dbd620c6824f2c6b5db9c7819e088db15.zip
ci(docker): multi-stage build
-rw-r--r--Dockerfile9
1 files changed, 5 insertions, 4 deletions
diff --git a/Dockerfile b/Dockerfile
index 0ed368d..35802df 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,3 +1,8 @@
+FROM python:3.11-alpine as builder
+
+RUN python -m pip install --no-cache-dir --upgrade pip
+RUN pip install --upgrade setuptools
+
FROM python:3.11-alpine
WORKDIR /due
@@ -6,15 +11,11 @@ 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