Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 19 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,22 +1,36 @@
FROM python:3.9-slim

# Set pip to have cleaner logs and no saved cache
# Set poetry to not make virtualenvs
# set pipx to use the same folder that pip puts scripts in
ENV PIP_NO_CACHE_DIR=false \
POETRY_VIRTUALENVS_CREATE=false
POETRY_VIRTUALENVS_IN_PROJECT=true \
POETRY_INSTALLER_PARALLEL=false \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whats the reason for adding this in? POETRY_INSTALLER_PARALLEL=false

PIPX_BIN_DIR=/usr/local/bin

# Install poetry
RUN pip install -U poetry
# install poetry
# this is pinned because sometimes versions have bugs, and this version is reliable enough to use
RUN pip install poetry==1.1.7

# See https://github.com/python-poetry/poetry/issues/3336
RUN poetry config experimental.new-installer false

# Create the working directory
WORKDIR /modmail

# copy the required files to install the dependencies.
COPY ./pyproject.toml .
COPY ./poetry.lock .


# Install project dependencies
RUN poetry install --no-dev --no-root

# Copy the source code in last to optimize rebuilding the image
COPY . .

# Install project dependencies
# install the package itself.
# this is required for importlib.metadata to work
RUN poetry install --no-dev

CMD ["python", "-m", "modmail"]
CMD ["poetry","run","python", "-m", "modmail"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is needed, it was working perfectly before this, even on railway. If it is needed, do add a comment here explaining why.

16 changes: 2 additions & 14 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -76,21 +76,9 @@ line-length = 110
target-version = ['py38']
include = '\.pyi?$'

[tool.taskipy.tasks.export]
cmd = """
echo 'Exporting installed packages to requirements.txt.\n\
This task automatically relocks the lock file using "poetry lock --no-update"' && \
poetry lock --no-update && \
echo '# Do not manually edit.\n# Generate with "poetry run task export"\n' > requirements.txt && \
echo "Exporting..." && \
poetry export --without-hashes >> requirements.txt && \
echo "Done exporting."
"""
help = "Export installed packages in requirements.txt format"

[tool.taskipy.tasks]
# Documentation
docs = { cmd = "mkdocs serve", help = "Run the docs on a local automatically reloading server"}
docs = { cmd = "mkdocs serve", help = "Run the docs on a local automatically reloading server" }

# Bot
start = { cmd = "python -m modmail", help = "Run bot" }
Expand All @@ -103,7 +91,7 @@ lint = { cmd = "pre-commit run --all-files", help = "Checks all files for CI err

# Testing
codecov-validate = { cmd = "curl --data-binary @.codecov.yml https://codecov.io/validate", help = "Validate `.codecov.yml` with their api." }
cov-server = { cmd = "coverage html", help = "Start an http.server for viewing coverage data."}
cov-server = { cmd = "coverage html", help = "Start an http.server for viewing coverage data." }
post-cov-server = "python -m http.server 8012 --bind 127.0.0.1 --directory htmlcov"
report = { cmd = "coverage report", help = "Show coverage report from previously run tests." }
test = { cmd = "pytest -n auto --dist loadfile", help = "Runs tests and save results to a coverage report" }
28 changes: 0 additions & 28 deletions requirements.txt

This file was deleted.