34 lines
998 B
Docker
34 lines
998 B
Docker
FROM python:3.12-slim-bookworm
|
|
|
|
# System dependencies for psycopg/postgres and general utilities
|
|
# System dependencies for psycopg/postgres, nodejs, and general utilities
|
|
RUN apt-get update && apt-get install -y \
|
|
libpq-dev \
|
|
gcc \
|
|
curl \
|
|
gnupg \
|
|
&& curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
|
|
&& apt-get install -y nodejs \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Install uv globally
|
|
RUN curl -LsSf https://astral.sh/uv/install.sh | env UV_INSTALL_DIR="/usr/local/bin" sh
|
|
ENV PATH="/usr/local/bin:$PATH"
|
|
|
|
# Prepare workspace
|
|
WORKDIR /app
|
|
COPY . /app
|
|
|
|
# Install dependencies using uv
|
|
# --system ensures it installs into the global python environment rather than venv
|
|
RUN uv pip install --system django psycopg django-environ gunicorn django-ninja django-cors-headers yt-dlp
|
|
|
|
# Install npm dependencies
|
|
RUN npm install
|
|
|
|
# Expose Django default port
|
|
EXPOSE 8000
|
|
|
|
# Run gunicorn standard server
|
|
CMD ["gunicorn", "pytv.wsgi:application", "--bind", "0.0.0.0:8000"]
|