Last active
November 5, 2025 23:04
-
-
Save gkmngrgn/718af73ac964d1658990c1d4f6ac5639 to your computer and use it in GitHub Desktop.
Initial Docker Setup for Uv + Django
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| .git | |
| .env | |
| db.sqlite3 | |
| /static |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM ghcr.io/astral-sh/uv:python3.13-alpine | |
| # Set environment variables | |
| ENV PYTHONDONTWRITEBYTECODE=1 | |
| ENV PYTHONUNBUFFERED=1 | |
| # Set the working directory | |
| WORKDIR /app | |
| # Install dependencies | |
| RUN apk add --no-cache gcc musl-dev libffi-dev curl | |
| # Copy the application code | |
| COPY . /app/ | |
| # Configure application | |
| RUN uv run --no-dev manage.py collectstatic --noinput | |
| # Expose the port the app runs on | |
| EXPOSE 8000 | |
| # Command to run the application | |
| CMD ["uv", "run", "--no-dev", "--group", "server", "python", "-m", "gunicorn", "app.asgi:application", "-k", "uvicorn_worker.UvicornWorker", "-b", "0.0.0.0:8000"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment