mirror of
https://github.com/semaphoreui/semaphore.git
synced 2024-11-23 20:35:24 +01:00
Merge pull request #2083 from tboerger/docker-requirementstxt-fix
feat: reduce container size and fix requirements.txt loading
This commit is contained in:
commit
f144075d95
@ -36,7 +36,8 @@ RUN apk add --no-cache -U \
|
||||
chown -R semaphore:0 /tmp/semaphore && \
|
||||
chown -R semaphore:0 /etc/semaphore && \
|
||||
chown -R semaphore:0 /var/lib/semaphore && \
|
||||
chown -R semaphore:0 /opt/semaphore
|
||||
chown -R semaphore:0 /opt/semaphore && \
|
||||
find /usr/lib/python* -iname __pycache__ | xargs rm -rf
|
||||
|
||||
COPY --chown=1001:0 ./deployment/docker/runner/ansible.cfg /tmp/semaphore/ansible.cfg
|
||||
COPY --from=builder /go/src/semaphore/deployment/docker/runner/runner-wrapper /usr/local/bin/
|
||||
@ -53,11 +54,11 @@ USER 1001
|
||||
# renovate: datasource=pypi depName=ansible
|
||||
ENV ANSIBLE_VERSION 9.4.0
|
||||
|
||||
RUN mkdir /opt/semaphore/venv
|
||||
|
||||
RUN python3 -m venv /opt/semaphore/venv --system-site-packages && \
|
||||
RUN mkdir /opt/semaphore/venv && \
|
||||
python3 -m venv /opt/semaphore/venv --system-site-packages && \
|
||||
source /opt/semaphore/venv/bin/activate && \
|
||||
pip3 install --upgrade pip ansible==${ANSIBLE_VERSION} boto3 botocore requests
|
||||
pip3 install --upgrade pip ansible==${ANSIBLE_VERSION} boto3 botocore requests && \
|
||||
find /opt/semaphore/venv -iname __pycache__ | xargs rm -rf
|
||||
|
||||
# Preventing ansible zombie processes. Tini kills zombies.
|
||||
ENTRYPOINT ["/sbin/tini", "--"]
|
||||
|
@ -18,7 +18,7 @@ fi
|
||||
|
||||
if test -f "${SEMAPHORE_CONFIG_PATH}/requirements.txt"; then
|
||||
echoerr "Installing additional python dependencies"
|
||||
pip3 install --upgrade --user \
|
||||
pip3 install --upgrade \
|
||||
-r "${SEMAPHORE_CONFIG_PATH}/requirements.txt"
|
||||
else
|
||||
echoerr "No additional python dependencies to install"
|
||||
|
@ -36,7 +36,8 @@ bash curl git gnupg mysql-client openssh-client-default python3 python3-dev py3-
|
||||
chown -R semaphore:0 /tmp/semaphore && \
|
||||
chown -R semaphore:0 /etc/semaphore && \
|
||||
chown -R semaphore:0 /var/lib/semaphore && \
|
||||
chown -R semaphore:0 /opt/semaphore
|
||||
chown -R semaphore:0 /opt/semaphore && \
|
||||
find /usr/lib/python* -iname __pycache__ | xargs rm -rf
|
||||
|
||||
COPY --chown=1001:0 ./deployment/docker/server/ansible.cfg /tmp/semaphore/ansible.cfg
|
||||
COPY --from=builder /go/src/semaphore/deployment/docker/server/server-wrapper /usr/local/bin/
|
||||
@ -53,11 +54,11 @@ USER 1001
|
||||
# renovate: datasource=pypi depName=ansible
|
||||
ENV ANSIBLE_VERSION 9.4.0
|
||||
|
||||
RUN mkdir /opt/semaphore/venv
|
||||
|
||||
RUN python3 -m venv /opt/semaphore/venv --system-site-packages && \
|
||||
RUN mkdir /opt/semaphore/venv && \
|
||||
python3 -m venv /opt/semaphore/venv --system-site-packages && \
|
||||
source /opt/semaphore/venv/bin/activate && \
|
||||
pip3 install --upgrade pip ansible==${ANSIBLE_VERSION} boto3 botocore requests
|
||||
pip3 install --upgrade pip ansible==${ANSIBLE_VERSION} boto3 botocore requests && \
|
||||
find /opt/semaphore/venv -iname __pycache__ | xargs rm -rf
|
||||
|
||||
# Preventing ansible zombie processes. Tini kills zombies.
|
||||
ENTRYPOINT ["/sbin/tini", "--"]
|
||||
|
@ -190,7 +190,7 @@ fi
|
||||
|
||||
if test -f "${SEMAPHORE_CONFIG_PATH}/requirements.txt"; then
|
||||
echoerr "Installing additional python dependencies"
|
||||
pip3 install --upgrade --user \
|
||||
pip3 install --upgrade \
|
||||
-r "${SEMAPHORE_CONFIG_PATH}/requirements.txt"
|
||||
else
|
||||
echoerr "No additional python dependencies to install"
|
||||
|
Loading…
Reference in New Issue
Block a user