-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile.dev
More file actions
35 lines (26 loc) · 872 Bytes
/
Dockerfile.dev
File metadata and controls
35 lines (26 loc) · 872 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
# ===== DEVELOPMENT DOCKERFILE =====
# Base image
FROM python:3.12-slim
# Set environment variables
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
# Working directory
WORKDIR /app
# Install system dependencies needed for builds
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc make libffi-dev libpq-dev curl git \
&& rm -rf /var/lib/apt/lists/*
# Install Poetry
RUN curl -sSL https://install.python-poetry.org | python3 - --version 1.6.1
ENV PATH="/root/.local/bin:$PATH"
# Copy project metadata
COPY pyproject.toml poetry.lock* /app/
# Install Python dependencies (dev mode)
RUN poetry config virtualenvs.create false \
&& poetry install --no-interaction --no-ansi
# Copy source code
COPY . /app/
# Expose port
EXPOSE 8000
# Set default command (Django dev server)
CMD ["python", "manage.py", "runserver", "0.0.0.0:8000"]