-
Notifications
You must be signed in to change notification settings - Fork 86
Expand file tree
/
Copy pathDockerfile
More file actions
36 lines (29 loc) · 833 Bytes
/
Dockerfile
File metadata and controls
36 lines (29 loc) · 833 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
36
FROM python:3.13-slim-bookworm
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
# Copy the application code to the container:
RUN mkdir /code/
WORKDIR /code/
ADD . /code/
# Install all build deps:
RUN set -ex \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
gcc \
gettext \
libjpeg-dev \
libpq-dev \
make \
postgresql-client \
|| (cat /var/log/apt/term.log || true) \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
RUN uv sync --frozen
# expose port
EXPOSE 8000
# Docker entrypoint:
ENV DJANGO_MANAGEPY_MIGRATE=on \
DJANGO_MANAGEPY_COLLECTSTATIC=on \
DJANGO_MANAGEPY_UPDATEINDEX=on
ENTRYPOINT ["/code/docker-entrypoint.sh"]
# Start python runserver:
CMD ["uv", "run", "python", "manage.py", "runserver", "0.0.0.0:8000"]