mirror of
https://github.com/MemeMeow-Studio/MemeMeow.git
synced 2026-10-27 21:03:56 +08:00
Wire runtime initialization, dynamic UID/GID interpolation, and non-root defaults through Compose and operational entry points. 在 Compose 与运维入口中接入运行时初始化、动态 UID/GID 插值和非 root 默认身份。
32 lines
714 B
Docker
32 lines
714 B
Docker
FROM node:22-slim AS frontend-build
|
|
|
|
WORKDIR /frontend
|
|
COPY frontend/package*.json ./
|
|
RUN npm ci
|
|
COPY frontend ./
|
|
RUN npm run build
|
|
|
|
FROM python:3.12-slim AS runtime
|
|
|
|
WORKDIR /app
|
|
|
|
RUN apt-get update && apt-get install -y --no-install-recommends libgl1 libglib2.0-0 && rm -rf /var/lib/apt/lists/*
|
|
|
|
COPY requirements.txt .
|
|
|
|
RUN pip install -r requirements.txt
|
|
|
|
COPY . .
|
|
COPY --from=frontend-build /frontend/dist ./frontend/dist
|
|
|
|
RUN groupadd --system mememeow \
|
|
&& useradd --system --create-home --gid mememeow --shell /bin/bash mememeow \
|
|
&& chown -R mememeow:mememeow /app
|
|
|
|
ENV HOME=/home/mememeow \
|
|
PYTHONUNBUFFERED=1
|
|
|
|
USER mememeow
|
|
|
|
CMD ["uvicorn", "api:app", "--host", "0.0.0.0", "--port", "8275"]
|