diff --git a/Dockerfile b/Dockerfile index 317d94a..f708a7b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,9 @@ # build ui # ############ -FROM node:lts AS build-ui +ARG NODE_VERSION=lts +ARG PYTHON_VERSION=3.12-slim +FROM node:${NODE_VERSION} AS build-ui # env setup WORKDIR /usr/local/src/ovdashboard_ui @@ -19,10 +21,8 @@ RUN yarn build --dest /tmp/ovdashboard_ui/html # web app # ########### -FROM tiangolo/uvicorn-gunicorn:python3.12-slim AS production - -# add prepared ovdashboard_ui -COPY --from=build-ui /tmp/ovdashboard_ui /usr/local/share/ovdashboard_ui +ARG PYTHON_VERSION +FROM tiangolo/uvicorn-gunicorn:python${PYTHON_VERSION} AS production # env setup WORKDIR /usr/local/src/ovdashboard_api @@ -46,5 +46,8 @@ RUN set -ex; \ # install ovdashboard_api python -m pip --no-cache-dir install ./ +# add prepared ovdashboard_ui +COPY --from=build-ui /tmp/ovdashboard_ui /usr/local/share/ovdashboard_ui + # run as unprivileged user USER nobody