Skip to content

update(Dockerfile): enhance the dockerfile

Import User requested to merge github/fork/imanimen/iman-dev into main

Environment Variables: Added PYTHONDONTWRITEBYTECODE to prevent Python from writing .pyc files and PYTHONUNBUFFERED to ensure logs are output directly.

Layer Caching: Separated the COPY requirements.txt and pip install to take advantage of Docker's caching mechanism, which speeds up builds when dependencies don't change.

No Cache for Pip: Used --no-cache-dir with pip install to reduce the image size by avoiding cache files. Order of Copying: Copied only the requirements.txt first, then the rest of the application code afterward to improve build performance.

Exposing Ports: Added an EXPOSE instruction to document the port the application runs on.

Merge request reports

Loading