Skip to content

Commit

Permalink
feat: use virtual env of python
Browse files Browse the repository at this point in the history
Signed-off-by: djerfy <[email protected]>
  • Loading branch information
djerfy committed Sep 4, 2024
1 parent d38146e commit 31225a9
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 15 deletions.
5 changes: 5 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
__pycache__/
*.py[cod]
.idea
.DS_Store
src/venv/
12 changes: 9 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,18 @@ ARG CONTAINER_GROUP="zabbix"

RUN apt-get update && \
apt-get upgrade -y && \
apt-get install -y --no-install-recommends curl iputils-ping python3 python3-pip && \
apt-get install -y --no-install-recommends \
curl \
iputils-ping \
python3 \
python3-pip \
python3-venv && \
rm -rf /var/lib/apt/lists && \
mkdir -p /app /root/.kube && \
touch /app/crontab && \
groupadd -g 2000 ${CONTAINER_GROUP} && \
useradd -u 2000 -d /app -s /bin/bash -M -g ${CONTAINER_GROUP} ${CONTAINER_USER}
useradd -u 2000 -d /app -s /bin/bash -M -g ${CONTAINER_GROUP} ${CONTAINER_USER} && \
python3 -m venv venv

ARG SUPERCRONIC_VER="0.2.31"
ARG SUPERCRONIC_SHA="fb4242e9d28528a76b70d878dbf69fe8d94ba7d2"
Expand All @@ -33,7 +39,7 @@ COPY ./src/ /app/

RUN chown ${CONTAINER_USER}:${CONTAINER_GROUP} -R /app && \
chmod +x /app/*.py && \
pip3 install --no-cache-dir -r /app/requirements.txt
/app/venv/bin/pip3 install --no-cache-dir -r /app/requirements.txt

USER ${CONTAINER_USER}:${CONTAINER_GROUP}

Expand Down
Loading

0 comments on commit 31225a9

Please sign in to comment.