djangoServer / Dockerfile
mohitlahoti2002's picture
update docker file for worker issue
eb347b7
Raw History Blame Contribute Delete
678 Bytes
FROM python:3.11
WORKDIR /app
RUN apt-get update && apt-get install -y \
gcc \
curl \
&& rm -rf /var/lib/apt/lists/*
RUN curl -LsSf https://astral.sh/uv/install.sh | sh
ENV PATH="/root/.local/bin:$PATH"
COPY pyproject.toml uv.lock ./
RUN uv sync --frozen --no-cache
# IMPORTANT: ensure .venv apps are used before system
ENV PATH="/app/.venv/bin:$PATH"
COPY . .
RUN mkdir -p /app/staticfiles_build /app/static /app/media /app/uploads
RUN chmod -R 777 /app/staticfiles_build /app/static /app/media /app/uploads
EXPOSE 7860
CMD ["sh", "-c", "python manage.py collectstatic --noinput && gunicorn djangoServer.wsgi:application --workers 2 --bind 0.0.0.0:7860"]