fix: setup_script should run with `USER bentoml`
@@ -59,6 +59,8 @@ COPY --chown={{ bento__user }}:{{ bento__user }} . ./
{% set __install_python_scripts__ = expands_bento_path("env", "python", "install.sh", bento_path=bento__path) %}
{{ common.run_script(__install_python_scripts__, "install.sh to install python packages", run_args="--mount=type=cache,mode=0777,target=/root/.cache/pip") }}
+USER bentoml
+
{% set __setup_script__ = expands_bento_path("env", "docker", "setup_script", bento_path=bento__path) %}
{{ common.run_script(__setup_script__, "user setup scripts") }}
@@ -71,8 +73,6 @@ EXPOSE 3000
RUN chmod +x {{ bento__entrypoint }}
-USER bentoml
-
ENTRYPOINT [ "{{ bento__entrypoint }}" ]
CMD [ "bentoml", "serve", "{{ bento__path }}", "--production" ]
