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

chore(server): avoid copying sources in dev #12794

Merged
merged 3 commits into from
Jan 14, 2025

Conversation

yonran
Copy link
Contributor

@yonran yonran commented Sep 19, 2024

Add a dev target to the web and server Dockerfiles, and change docker-compose.dev.yml to use the dev target. The dev target avoids copying files so that the docker image is smaller.

My motivation was that when I tried using docker-compose.dev.yml, I kept running out of disk space because docker would create big docker containers with copies of the application code even though they weren’t being used.

Add a dev target to the web and server Dockerfiles, and change docker-compose.dev.yml to use the dev target. The dev target avoids copying files so that the docker image is smaller.
@@ -55,6 +55,7 @@ services:
image: immich-web-dev:latest
build:
context: ../web
target: dev
Copy link
Contributor

Choose a reason for hiding this comment

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

the web Dockerfile is only ever used for development so you can revert related changes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry for taking so long. I have removed the target: dev and removed the COPY from the web/Dockerfile completely so that it can only be used with the source volume.

@alextran1502
Copy link
Contributor

Hello, any update on this PR?

web/Dockerfile is only used by docker-compose.dev.yml so a dev target is redundant. Instead, just remove the copy
@zackpollard
Copy link
Contributor

Hey @yonran, is this ready to be reviewed and merged? Changes look simple, if they're good from your end I can give this a quick test and merge it in.

@yonran
Copy link
Contributor Author

yonran commented Nov 13, 2024

Hey @yonran, is this ready to be reviewed and merged? Changes look simple, if they're good from your end I can give this a quick test and merge it in.

Yes please

@jrasm91 jrasm91 merged commit fc99c5f into immich-app:main Jan 14, 2025
33 checks passed
arctic-foxtato pushed a commit to arctic-foxtato/immich that referenced this pull request Jan 14, 2025
* chore(server): avoid copying sources in dev

Add a dev target to the web and server Dockerfiles, and change docker-compose.dev.yml to use the dev target. The dev target avoids copying files so that the docker image is smaller.

* chore: respond to PR: don't add dev target

web/Dockerfile is only used by docker-compose.dev.yml so a dev target is redundant. Instead, just remove the copy

---------

Co-authored-by: Jason Rasmussen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants