File size: 726 Bytes
7c93e8c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
FROM node:20-slim AS builder
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
RUN npm run build

FROM python:3.11-slim
RUN apt-get update && apt-get install -y \
	fontconfig \
	curl \
	&& rm -rf /var/lib/apt/lists/*

# Install custom fonts
COPY core/data/*.ttf /usr/share/fonts/truetype/
RUN fc-cache -f -v

# Create a non-root user required by Hugging Face Spaces
RUN useradd -m -u 1000 user
USER user
ENV HOME=/home/user \
	PATH=/home/user/.local/bin:$PATH

WORKDIR $HOME/app
COPY --chown=user requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY --chown=user . .
COPY --from=builder --chown=user /app/out ./out

EXPOSE 7860
CMD ["uvicorn", "core.api:app", "--host", "0.0.0.0", "--port", "7860"]