Spaces:
Sleeping
Sleeping
File size: 1,017 Bytes
d7a8925 1e0c4ef f657ad3 d7a8925 f657ad3 d7a8925 |
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 |
# Build frontend
FROM node:18-alpine as frontend-build
WORKDIR /frontend
COPY podcraft/package*.json ./
RUN npm install
COPY podcraft/ .
RUN npm run build
# Build backend
FROM python:3.11-slim
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y \
build-essential \
&& rm -rf /var/lib/apt/lists/*
# Copy and install Python dependencies
COPY server/requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy backend code
COPY server/ .
# Create necessary directories with proper permissions
RUN mkdir -p audio_storage transcripts logs && \
chmod -R 777 audio_storage transcripts logs && \
chown -R nobody:nogroup audio_storage transcripts logs
# Copy frontend build to a static directory
COPY --from=frontend-build /frontend/dist /app/static
# Switch to non-root user
USER nobody
# Expose port
EXPOSE 7860
# Start FastAPI application
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"] |