Merge pull request #5919 from Nowheresly/dockerwarn

refac: remove docker warnings during image build
This commit is contained in:
Timothy Jaeryang Baek 2024-10-05 18:33:11 +02:00 committed by GitHub
commit 4ca870bf6d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -17,7 +17,7 @@ ARG UID=0
ARG GID=0 ARG GID=0
######## WebUI frontend ######## ######## WebUI frontend ########
FROM --platform=$BUILDPLATFORM node:21-alpine3.19 as build FROM --platform=$BUILDPLATFORM node:21-alpine3.19 AS build
ARG BUILD_HASH ARG BUILD_HASH
WORKDIR /app WORKDIR /app
@ -30,7 +30,7 @@ ENV APP_BUILD_HASH=${BUILD_HASH}
RUN npm run build RUN npm run build
######## WebUI backend ######## ######## WebUI backend ########
FROM python:3.11-slim-bookworm as base FROM python:3.11-slim-bookworm AS base
# Use args # Use args
ARG USE_CUDA ARG USE_CUDA
@ -82,7 +82,7 @@ ENV HF_HOME="/app/backend/data/cache/embedding/models"
WORKDIR /app/backend WORKDIR /app/backend
ENV HOME /root ENV HOME=/root
# Create user and group if not root # Create user and group if not root
RUN if [ $UID -ne 0 ]; then \ RUN if [ $UID -ne 0 ]; then \
if [ $GID -ne 0 ]; then \ if [ $GID -ne 0 ]; then \
@ -161,6 +161,6 @@ USER $UID:$GID
ARG BUILD_HASH ARG BUILD_HASH
ENV WEBUI_BUILD_VERSION=${BUILD_HASH} ENV WEBUI_BUILD_VERSION=${BUILD_HASH}
ENV DOCKER true ENV DOCKER=true
CMD [ "bash", "start.sh"] CMD [ "bash", "start.sh"]