28 lines
695 B
Docker
28 lines
695 B
Docker
FROM python:3.11-slim AS runtime
|
|
|
|
ENV PYTHONDONTWRITEBYTECODE=1 \
|
|
PYTHONUNBUFFERED=1 \
|
|
PIP_DISABLE_PIP_VERSION_CHECK=1
|
|
|
|
WORKDIR /app
|
|
|
|
RUN apt-get update \
|
|
&& apt-get install -y --no-install-recommends default-libmysqlclient-dev pkg-config gcc \
|
|
&& addgroup --system hulumath \
|
|
&& adduser --system --ingroup hulumath hulumath \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
COPY requirements.txt .
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
COPY backend ./backend
|
|
COPY docs ./docs
|
|
|
|
WORKDIR /app/backend
|
|
RUN python manage.py collectstatic --noinput
|
|
|
|
USER hulumath
|
|
EXPOSE 8000
|
|
|
|
CMD ["uvicorn", "config.asgi:application", "--host", "0.0.0.0", "--port", "8000", "--proxy-headers"]
|