make docker build uses the next UI

This commit is contained in:
ArabCoders 2024-12-14 20:14:58 +03:00
parent 0239e509de
commit 4b322a6f5a
4 changed files with 10 additions and 9 deletions

View file

@ -1,3 +1,3 @@
.git
.venv
ui/
cd

1
.gitignore vendored
View file

@ -1,5 +1,6 @@
# compiled output
/frontend/dist
/ui/dist
# dependencies
**/node_modules/*

View file

@ -1,8 +1,8 @@
FROM node:lts-alpine AS npm_builder
FROM node:lts-alpine AS node_builder
WORKDIR /ytptube
COPY frontend ./
RUN npm ci && npm run build
WORKDIR /app
COPY ui ./
RUN yarn install --production --prefer-offline --frozen-lockfile && yarn run generate
FROM python:3.11-alpine AS python_builder
@ -44,7 +44,7 @@ COPY entrypoint.sh /
RUN sed -i 's/\r$//g' /entrypoint.sh && chmod +x /entrypoint.sh
COPY --chown=app:app ./app /app/app
COPY --chown=app:app --from=npm_builder /ytptube/dist /app/frontend/dist
COPY --chown=app:app --from=node_builder /app/exported /app/ui/dist
COPY --chown=app:app --from=python_builder /app/.venv /opt/python
COPY --chown=app:app ./healthcheck.sh /usr/local/bin/healthcheck

View file

@ -594,7 +594,7 @@ class Main:
if not self.appLoader:
with open(os.path.join(
os.path.dirname(os.path.dirname(os.path.realpath(__file__))),
'frontend/dist/index.html'
'ui/dist/index.html'
), 'r') as f:
self.appLoader = f.read()
@ -809,7 +809,7 @@ class Main:
'X-Via': 'memory' if not item.get('file', None) else 'disk',
})
staticDir = os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))), 'frontend/dist')
staticDir = os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))), 'ui/dist')
for root, _, files in os.walk(staticDir):
for file in files:
if file.endswith('.map'):
@ -838,7 +838,7 @@ class Main:
self.app.on_response_prepare.append(on_prepare)
except ValueError as e:
if 'frontend/dist' in str(e):
if 'ui/dist' in str(e):
raise RuntimeError('Could not find the frontend UI static assets.') from e
raise e