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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

yonran
Copy link

@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
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
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.

3 participants