Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dockerfile copies all files from local folder #207

Open
mgv99 opened this issue Feb 6, 2025 · 0 comments
Open

Dockerfile copies all files from local folder #207

mgv99 opened this issue Feb 6, 2025 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@mgv99
Copy link
Collaborator

mgv99 commented Feb 6, 2025

Dockerfile in BESSER:

*# Copy requirements.txt first for better caching*

COPY besser/utilities/web_modeling_editor/backend/requirements.txt /app/requirements.txt

RUN pip install --no-cache-dir -r requirements.txt*# Copy the entire project*

COPY . .

If we run pip install and then copy all (last command), we are copying any dependencies that are installed in our local folder (including other things), this increases the image size unnecessary (e.g. if my local venv has other dependencies). I would not do COPY . . and instead just copy the besser folder + other files in root folder (if necessary)

Same in django generated dockerfile:

*# Copy the application files into the container*

COPY . /code/

@mgv99 mgv99 added the enhancement New feature or request label Feb 6, 2025
@ivan-alfonso ivan-alfonso added the good first issue Good for newcomers label Feb 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants