-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
54 lines (38 loc) · 1.32 KB
/
Dockerfile
File metadata and controls
54 lines (38 loc) · 1.32 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# Use the official Python runtime image
FROM python:3.13
# The installer requires curl (and certificates) to download the release archive
# Also install PostgreSQL client tools for pg_isready
RUN apt-get update && apt-get install -y --no-install-recommends \
curl \
ca-certificates \
postgresql-client \
&& rm -rf /var/lib/apt/lists/*
# Download the latest installer
ADD https://astral.sh/uv/install.sh /uv-installer.sh
# Run the installer then remove it
RUN sh /uv-installer.sh && rm /uv-installer.sh
# Ensure the installed binary is on the `PATH`
ENV PATH="/root/.local/bin/:$PATH"
# Create the app directory
RUN mkdir /app
# Set the working directory inside the container
WORKDIR /app
# Set environment variables
# Prevents Python from writing pyc files to disk
ENV PYTHONDONTWRITEBYTECODE=1
#Prevents Python from buffering stdout and stderr
ENV PYTHONUNBUFFERED=1
# Upgrade pip
RUN pip install --upgrade pip
# Copy the Django project and install dependencies
COPY pyproject.toml /app/
# run this command to install all dependencies
# RUN uv pip install --no-cache-dir -r pyproject.toml
RUN uv sync
# Copy the Django project to the container
COPY . /app/
RUN chmod +x /app/entrypoint.sh
# Expose the Django port
EXPOSE 8000
# Use entrypoint script as the entry point
ENTRYPOINT ["/app/entrypoint.sh"]