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

Drop root during base image build and use venv #1682

Merged
merged 2 commits into from
Sep 29, 2024
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ on:

env:
PYTHON_VERSION: "3.11"
BASE_IMAGE_VERSION_STABLE: "1.0.10"
BASE_IMAGE_VERSION_BETA: "1.0.10"
BASE_IMAGE_VERSION_STABLE: "1.1.0"
BASE_IMAGE_VERSION_BETA: "1.1.0"

jobs:
build-artifact:
Expand Down
18 changes: 12 additions & 6 deletions Dockerfile.base
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,24 @@ RUN set -x \
RUN mkdir -p /usr/local/bin/widevine_cdm
COPY widevine_cdm/* /usr/local/bin/widevine_cdm/

# Upgrade pip + Install uv
RUN pip install --upgrade pip \
&& pip install uv==0.2.27
RUN adduser -D app app \
&& chmod -R 775 /tmp \
&& chgrp -R app /tmp

WORKDIR /home/app
USER app


# Configure runtime environmental variables
ENV LD_PRELOAD="/usr/lib/libjemalloc.so.2"
ENV VIRTUAL_ENV=/opt/venv
ENV VIRTUAL_ENV=/home/app/venv

# create venv and set some permissions to allow running the container as non-root
RUN python3 -m venv $VIRTUAL_ENV && \
chmod -R 777 $VIRTUAL_ENV && \
chmod -R 777 /tmp

source $VIRTUAL_ENV/bin/activate && \
pip install --upgrade pip \
&& pip install uv==0.4.17

ENV PATH="$VIRTUAL_ENV/bin:$PATH"
WORKDIR $VIRTUAL_ENV
Expand Down