main dockerfile fixes
This commit is contained in:
parent
5897d2f2c7
commit
a5348a9987
1 changed files with 8 additions and 5 deletions
13
Dockerfile
13
Dockerfile
|
@ -2,7 +2,9 @@
|
||||||
# build ui #
|
# 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
|
# env setup
|
||||||
WORKDIR /usr/local/src/ovdashboard_ui
|
WORKDIR /usr/local/src/ovdashboard_ui
|
||||||
|
@ -19,10 +21,8 @@ RUN yarn build --dest /tmp/ovdashboard_ui/html
|
||||||
# web app #
|
# web app #
|
||||||
###########
|
###########
|
||||||
|
|
||||||
FROM tiangolo/uvicorn-gunicorn:python3.12-slim AS production
|
ARG PYTHON_VERSION
|
||||||
|
FROM tiangolo/uvicorn-gunicorn:python${PYTHON_VERSION} AS production
|
||||||
# add prepared ovdashboard_ui
|
|
||||||
COPY --from=build-ui /tmp/ovdashboard_ui /usr/local/share/ovdashboard_ui
|
|
||||||
|
|
||||||
# env setup
|
# env setup
|
||||||
WORKDIR /usr/local/src/ovdashboard_api
|
WORKDIR /usr/local/src/ovdashboard_api
|
||||||
|
@ -46,5 +46,8 @@ RUN set -ex; \
|
||||||
# install ovdashboard_api
|
# install ovdashboard_api
|
||||||
python -m pip --no-cache-dir install ./
|
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
|
# run as unprivileged user
|
||||||
USER nobody
|
USER nobody
|
||||||
|
|
Loading…
Reference in a new issue