File size: 576 Bytes
f17b878
 
 
 
 
 
 
 
 
0986c85
f17b878
 
 
 
 
 
0986c85
 
 
 
 
 
433d501
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
FROM python:3.10-slim

# Install C++ compiler for llama-cpp
RUN apt-get update && apt-get install -y build-essential && rm -rf /var/lib/apt/lists/*

WORKDIR /app

# Install dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir huggingface_hub llama-cpp-python gunicorn flask requests python-dotenv
COPY . .

# Railway uses the PORT env var
ENV PORT=8080
EXPOSE 8080

#creates user appuser and sets ownership of /app to that user
RUN useradd -m appuser
RUN chown -R appuser:appuser /app

USER appuser

CMD ["gunicorn", "--bind", "0.0.0.0:8080", "backend.app:app"]