diff options
-rw-r--r-- | Dockerfile | 7 | ||||
-rwxr-xr-x | docker/entrypoint.sh | 3 |
2 files changed, 4 insertions, 6 deletions
@@ -5,9 +5,7 @@ FROM base AS build RUN apk add --no-cache gcc libffi-dev make musl-dev python3-dev py3-pip COPY ["requirements.txt", "/tmp/"] -RUN python3 -m venv /tmp/venv && \ - . /tmp/venv/bin/activate && \ - python3 -m pip install -r /tmp/requirements.txt +RUN pip3 install --no-cache-dir --target=/deps -r /tmp/requirements.txt FROM base @@ -15,7 +13,8 @@ LABEL maintainer="Egor Tensin <Egor.Tensin@gmail.com>" RUN apk add --no-cache bash git openssh-client python3 tini -COPY --from=build ["/tmp/venv", "/tmp/venv/"] +COPY --from=build ["/deps", "/deps/"] +ENV PYTHONPATH="/deps" ARG ssh_sock_dir=/ ARG ssh_sock_path="$ssh_sock_dir/ssh-agent.sock" diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index f8bd832..6e755b3 100755 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -11,7 +11,6 @@ schedule="${SCHEDULE:-once}" case "$schedule" in once) - . /tmp/venv/bin/activate exec "$@" ;; 15min) schedule='*/15 * * * *' ;; @@ -23,7 +22,7 @@ case "$schedule" in esac script="#!/bin/bash -cd /usr/src && . /tmp/venv/bin/activate &&$( printf -- ' %q' "$@" )" +cd /usr/src &&$( printf -- ' %q' "$@" )" echo "$script" > /task.sh chmod +x /task.sh |