47 lines
1.1 KiB
Docker
47 lines
1.1 KiB
Docker
FROM python:3.13-slim
|
|
|
|
# Install FFmpeg, opustags, system dependencies, and gosu from APT
|
|
RUN apt-get update && \
|
|
apt-get install -y --no-install-recommends \
|
|
ffmpeg \
|
|
opustags \
|
|
ca-certificates \
|
|
gosu \
|
|
&& \
|
|
apt-get clean && \
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
# Set Python environment variables
|
|
ENV PYTHONDONTWRITEBYTECODE=1 \
|
|
PYTHONUNBUFFERED=1
|
|
|
|
# Set working directory
|
|
WORKDIR /app
|
|
|
|
# Copy requirements and install Python dependencies
|
|
COPY web/backend/requirements-web.txt .
|
|
RUN pip install --no-cache-dir -r requirements-web.txt
|
|
|
|
# Copy backend code
|
|
COPY web/backend /app/backend
|
|
|
|
# Copy and install audio_splitter package
|
|
COPY audio_splitter /app/audio_splitter
|
|
COPY setup.py pyproject.toml README.md /app/
|
|
RUN pip install --no-cache-dir /app
|
|
|
|
# Create a non-root user
|
|
RUN addgroup --system --gid 1000 appgroup && \
|
|
adduser --system --uid 1000 --ingroup appgroup appuser && \
|
|
chown -R appuser:appgroup /app
|
|
|
|
# Copy entrypoint script
|
|
COPY web/backend/docker-entrypoint.sh /docker-entrypoint.sh
|
|
RUN chmod +x /docker-entrypoint.sh
|
|
|
|
# Set entrypoint
|
|
ENTRYPOINT ["/docker-entrypoint.sh"]
|
|
|
|
# Expose port
|
|
EXPOSE 8000
|