-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
38 lines (29 loc) · 886 Bytes
/
Copy pathDockerfile
File metadata and controls
38 lines (29 loc) · 886 Bytes
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
# Dockerfile
# Stage 1: Build the React Frontend
FROM node:20-alpine as frontend-build
WORKDIR /app/frontend
COPY frontend/package*.json ./
RUN npm ci
COPY frontend/ .
RUN npm run build
# Stage 2: Build the Python Backend
FROM python:3.11-slim
WORKDIR /app
# Install system dependencies for audio processing
RUN apt-get update && apt-get install -y \
ffmpeg \
gcc \
&& rm -rf /var/lib/apt/lists/*
# Copy backend requirements
COPY backend/requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy backend code
COPY backend/ .
# Copy built frontend assets from Stage 1 to backend 'static' folder
COPY --from=frontend-build /app/frontend/dist /app/static
# Environment variables
ENV PYTHONUNBUFFERED=1
# Expose port (Azure uses 8000 or 80 usually)
EXPOSE 8000
# Run the application
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]