feat(server): modularize backend and admin console
This commit is contained in:
+19
-4
@@ -1,3 +1,14 @@
|
||||
FROM node:22-alpine AS admin_ui_builder
|
||||
|
||||
WORKDIR /ui
|
||||
|
||||
COPY admin-ui/package*.json ./
|
||||
RUN npm ci
|
||||
|
||||
COPY admin-ui ./
|
||||
RUN npm run build
|
||||
|
||||
|
||||
FROM python:3.12-slim
|
||||
|
||||
ENV PYTHONDONTWRITEBYTECODE=1 \
|
||||
@@ -10,15 +21,19 @@ RUN apt-get update \
|
||||
&& apt-get install -y --no-install-recommends libarchive-tools \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
COPY server/requirements.txt ./requirements.txt
|
||||
COPY requirements.txt ./requirements.txt
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
COPY server/main.py server/db.py server/minio_tool.py server/tables.sql ./
|
||||
COPY --chown=updateapp:updateapp server/admin.html ./admin.html
|
||||
COPY main.py db.py minio_tool.py tables.sql ./
|
||||
COPY app ./app
|
||||
COPY --chown=updateapp:updateapp legacy/admin.html ./legacy/admin.html
|
||||
COPY --from=admin_ui_builder --chown=updateapp:updateapp /ui/dist ./admin-ui/dist
|
||||
|
||||
RUN mkdir -p /data/uploads /data/upload_spool /run/secrets/update-keys \
|
||||
&& chown -R updateapp:updateapp /app /data \
|
||||
&& chmod 644 /app/admin.html
|
||||
&& chmod 644 /app/legacy/admin.html \
|
||||
&& find /app/admin-ui/dist -type f -exec chmod 644 {} \; \
|
||||
&& find /app/admin-ui/dist -type d -exec chmod 755 {} \;
|
||||
|
||||
USER updateapp
|
||||
|
||||
|
||||
Reference in New Issue
Block a user