@@ -10,37 +10,44 @@ FROM python:${PYTHON_VERSION}-slim-buster as base
1010
1111LABEL maintainer=mguidon
1212
13+ RUN set -eux; \
14+ apt-get update; \
15+ apt-get install -y gosu; \
16+ rm -rf /var/lib/apt/lists/*; \
17+ # verify that the binary works
18+ gosu nobody true
19+
1320# simcore-user uid=8004(scu) gid=8004(scu) groups=8004(scu)
1421ENV SC_USER_ID=8004 \
15- SC_USER_NAME=scu \
16- SC_BUILD_TARGET=base \
17- SC_BOOT_MODE=default
22+ SC_USER_NAME=scu \
23+ SC_BUILD_TARGET=base \
24+ SC_BOOT_MODE=default
1825
1926RUN adduser \
20- --uid ${SC_USER_ID} \
21- --disabled-password \
22- --gecos "" \
23- --shell /bin/sh \
24- --home /home/${SC_USER_NAME} \
25- ${SC_USER_NAME}
27+ --uid ${SC_USER_ID} \
28+ --disabled-password \
29+ --gecos "" \
30+ --shell /bin/sh \
31+ --home /home/${SC_USER_NAME} \
32+ ${SC_USER_NAME}
2633
2734# Sets utf-8 encoding for Python et al
2835ENV LANG=C.UTF-8
2936# Turns off writing .pyc files; superfluous on an ephemeral container.
3037ENV PYTHONDONTWRITEBYTECODE=1 \
31- VIRTUAL_ENV=/home/scu/.venv
38+ VIRTUAL_ENV=/home/scu/.venv
3239# Ensures that the python and pip executables used
3340# in the image will be those from our virtualenv.
3441ENV PATH="${VIRTUAL_ENV}/bin:$PATH"
3542
3643# environment variables
3744ENV SWARM_STACK_NAME="" \
38- SIDECAR_SERVICES_MAX_NANO_CPUS=4000000000 \
39- SIDECAR_SERVICES_MAX_MEMORY_BYTES=2147483648 \
40- SIDECAR_SERVICES_TIMEOUT_SECONDS=1200 \
41- SIDECAR_INPUT_FOLDER=/home/scu/input \
42- SIDECAR_OUTPUT_FOLDER=/home/scu/output \
43- SIDECAR_LOG_FOLDER=/home/scu/log
45+ SIDECAR_SERVICES_MAX_NANO_CPUS=4000000000 \
46+ SIDECAR_SERVICES_MAX_MEMORY_BYTES=2147483648 \
47+ SIDECAR_SERVICES_TIMEOUT_SECONDS=1200 \
48+ SIDECAR_INPUT_FOLDER=/home/scu/input \
49+ SIDECAR_OUTPUT_FOLDER=/home/scu/output \
50+ SIDECAR_LOG_FOLDER=/home/scu/log
4451
4552EXPOSE 8080
4653
@@ -54,16 +61,16 @@ FROM base as build
5461ENV SC_BUILD_TARGET=build
5562
5663RUN apt-get update &&\
57- apt-get install -y --no-install-recommends \
58- build-essential
64+ apt-get install -y --no-install-recommends \
65+ build-essential
5966
6067# NOTE: python virtualenv is used here such that installed packages may be moved to production image easily by copying the venv
6168RUN python -m venv ${VIRTUAL_ENV}
6269
6370RUN pip --no-cache-dir install --upgrade \
64- pip~=20.2.2 \
65- wheel \
66- setuptools
71+ pip~=20.2.2 \
72+ wheel \
73+ setuptools
6774
6875# copy sidecar and dependencies
6976COPY --chown=scu:scu packages /build/packages
@@ -95,7 +102,7 @@ RUN pip --no-cache-dir install -r requirements/prod.txt
95102FROM base as production
96103
97104ENV SC_BUILD_TARGET=production \
98- SC_BOOT_MODE=production
105+ SC_BOOT_MODE=production
99106ENV PYTHONOPTIMIZE=TRUE
100107
101108WORKDIR /home/scu
0 commit comments