-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
58 lines (48 loc) · 1.26 KB
/
Copy pathDockerfile
File metadata and controls
58 lines (48 loc) · 1.26 KB
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
FROM python:3.11-slim
# Install system dependencies
RUN apt-get update && apt-get install -y \
curl \
git \
libsndfile1 \
ffmpeg \
&& rm -rf /var/lib/apt/lists/*
# Install Node.js 22
RUN curl -fsSL https://deb.nodesource.com/setup_22.x | bash - && \
apt-get install -y nodejs
# Create non-root user
RUN useradd -m -u 1000 user
USER user
ENV HOME=/home/user \
PATH=/home/user/.local/bin:$PATH
WORKDIR $HOME/app
# Copy project files
COPY --chown=user . .
# Install Python dependencies
RUN pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir \
torch --index-url https://download.pytorch.org/whl/cpu && \
pip install --no-cache-dir \
fastapi==0.104.1 \
uvicorn==0.24.0 \
scikit-learn>=1.7.1 \
pandas>=2.2.3 \
"numpy>=1.24.0,<2.0" \
umap-learn \
scikit-activeml>=0.6.2 \
faiss-cpu \
librosa>=0.10.0 \
matplotlib>=3.7.0 \
pyyaml \
soundfile \
python-multipart==0.0.6
# Build React frontend (empty VITE_API_URL = same-origin requests)
WORKDIR $HOME/app/app
ENV VITE_API_URL=""
RUN npm install && npm run build
# Back to root
WORKDIR $HOME/app
# Railway sets PORT env var; default to 7860 for local dev
ENV PORT=7860
EXPOSE $PORT
# Start the application
CMD ["python", "app.py"]