Skip to content

Commit 880c1a4

Browse files
committed
fix(docker): Move install to last step
------------ The Problems ------------ There are namely two problems which are being fixed in this issue: 1. `pyproject.toml` defines `modmail` package to be included, thus poetry searches for it but finds it be to be empty as originally we copied the poetry meta files only before installing and then copied rest of the package. 2. We are using pip to install poetry, we uses the new installer, the new installer has a known bug see python-poetry/poetry#3336 but the issue hasn't shown any acitivty since it has been opened unfortunately. ------------ The Solution ----------- 1. I have moved `COPY . .` to be ran before poetry install so poetry can find what the package to be included. 2. The only possible solution to this is to disable the old installer which was causing this bug for some reason.
1 parent c7e6255 commit 880c1a4

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

Dockerfile

+6-4
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,16 @@ RUN apt-get update && apt-get install -y \
1414
# Install poetry
1515
RUN pip install -U poetry
1616

17+
# See https://github.com/python-poetry/poetry/issues/3336
18+
RUN poetry config experimental.new-installer false
19+
1720
# Create the working directory
1821
WORKDIR /modmail
1922

20-
# Install project dependencies
21-
COPY pyproject.toml poetry.lock ./
22-
RUN poetry install --no-dev
23-
2423
# Copy the source code in last to optimize rebuilding the image
2524
COPY . .
2625

26+
# Install project dependencies
27+
RUN poetry install --no-dev
28+
2729
CMD ["python", "-m", "modmail"]

0 commit comments

Comments
 (0)