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

Reduce build dependencies in Dockerfile #60

Merged
merged 1 commit into from
Jul 20, 2024
Merged
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
8 changes: 5 additions & 3 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@ COPY ./src/ ./src/
COPY ./assets/ ./assets/
COPY ./locales/ ./locales/

# Rust is needed for orjson
RUN apk add --no-cache git python3 py3-pip rust cargo tini && \
RUN apk add --no-cache git python3 py3-setuptools tini && \
addgroup -g 1000 -S priviblur && \
adduser -u 1000 -S priviblur -G priviblur && \
pip3 install --break-system-packages -r requirements.txt && \
apk add --no-cache py3-pip && \
Copy link
Contributor

Choose a reason for hiding this comment

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

Why move this here instead of the first line?

Copy link
Contributor Author

@sgvictorino sgvictorino Jul 21, 2024

Choose a reason for hiding this comment

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

I thought it'd be slightly more clear to only declare the long-lived, runtime dependencies there.

Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like a mistake honestly :')

Also, you should have added a comment to say that it's only a build dependency

pip3 install --no-cache-dir --break-system-packages -r requirements.txt && \
pip3 cache purge && \
apk del py3-pip && \
pybabel compile -d locales -D priviblur && \
# chown is needed otherwise git will error out with "fatal: detected dubious ownership in repository at '/priviblur'"
chown -R priviblur:priviblur /priviblur && \
Expand Down