-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile.dev
More file actions
36 lines (26 loc) · 844 Bytes
/
Dockerfile.dev
File metadata and controls
36 lines (26 loc) · 844 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
# Use a lightweight Python image
FROM python:3.11-slim
# Set environment variables
# Set working directory
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y \
python3-dev \
&& rm -rf /var/lib/apt/lists/*
# Install PDM
RUN pip install pdm
ENV PDM_VENV_IN_PROJECT=1
ENV PATH="/app/.venv/bin:$PATH"
# Copy only dependency files first (better caching)
COPY README.md LICENSE pyproject.toml pdm.lock ./
# Create the virtual environment explicitly
RUN pdm venv create --force
# Install dependencies properly inside the virtual environment
RUN pdm install
# Copy the rest of the project files (excluding `.venv`)
COPY . .
# Copy the new entrypoint script
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
# Use the entrypoint script to handle startup tasks
ENTRYPOINT ["/entrypoint.sh"]