-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
35 lines (21 loc) · 787 Bytes
/
Dockerfile
File metadata and controls
35 lines (21 loc) · 787 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
FROM python:3.13-slim AS base
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
ENV DJANGO_SETTINGS_MODULE humanify_project.settings.prod
WORKDIR /code
RUN apt-get update && apt-get install ffmpeg libsm6 libxext6 -y
EXPOSE 80
RUN pip install uv
COPY pyproject.toml ./
RUN uv sync --no-dev
COPY . .
FROM base AS production
RUN groupadd -r appgroup && \
useradd --no-log-init -m -r -g appgroup appuser && \
chown -R appuser:appgroup /code
USER appuser
RUN uv run python manage.py collectstatic --noinput
CMD ["uv", "run", "gunicorn", "--bind", "0.0.0.0:80", "humanify_project.wsgi:application"]
FROM base AS development
RUN uv run python manage.py collectstatic --noinput
CMD ["uv", "run", "gunicorn", "--bind", "0.0.0.0:80", "humanify_project.wsgi:application"]