File size: 905 Bytes
f9474bf
 
 
9b949a9
 
f9474bf
9b949a9
f9474bf
 
 
 
 
 
5109c68
 
f9474bf
5109c68
f9474bf
 
 
5109c68
f9474bf
 
5109c68
f9474bf
 
5109c68
f9474bf
 
 
5109c68
 
f9474bf
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# Stage 1: Frontend Builder
FROM node:20-alpine AS frontend-builder
WORKDIR /app/frontend
COPY frontend/package.json frontend/package-lock.json ./
RUN npm ci
COPY frontend/ ./
RUN npm run build

# Stage 2: Final Python Image
FROM python:3.11.9-slim-bookworm AS final

RUN apt-get update && apt-get install -y --no-install-recommends \
    curl git gcc libffi-dev libssl-dev ca-certificates \
    && rm -rf /var/lib/apt/lists/*

RUN groupadd -g 1000 appuser && useradd -r -u 1000 -g appuser appuser

WORKDIR /app
COPY backend/requirements.txt ./backend/requirements.txt
RUN pip install --no-cache-dir -r ./backend/requirements.txt

COPY backend/ ./backend/
COPY --from=frontend-builder /app/frontend/dist ./backend/static

COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh

ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
ENV DATA_DIR=/data

EXPOSE 7860
USER appuser
CMD ["/entrypoint.sh"]