-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.dev
More file actions
51 lines (41 loc) · 1.21 KB
/
Copy pathDockerfile.dev
File metadata and controls
51 lines (41 loc) · 1.21 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
# Development Dockerfile for GPU Compute Platform
# Optimized for development with hot reload and debugging
FROM nvidia/cuda:12.1-runtime-ubuntu22.04
# Install system dependencies
RUN apt-get update && apt-get install -y \
python3.12 \
python3.12-venv \
python3-pip \
curl \
git \
build-essential \
libpq-dev \
wget \
vim \
htop \
&& rm -rf /var/lib/apt/lists/*
# Install uv package manager
RUN pip3 install uv
# Create non-root user
RUN useradd -m -u 1000 appuser && \
mkdir -p /app && \
chown -R appuser:appuser /app
USER appuser
WORKDIR /app
# Copy Python project configuration
COPY --chown=appuser:appuser pyproject.toml ./
# Install Python dependencies with uv (including dev dependencies)
RUN uv venv .venv && \
. .venv/bin/activate && \
uv pip install -e . && \
uv pip install ipython jupyter jupyterlab pytest-xdist
# Set environment variables for development
ENV PATH="/app/.venv/bin:$PATH"
ENV PYTHONPATH="/app"
ENV ENVIRONMENT="development"
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
# Default working directory
WORKDIR /app
# Default command for development
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000", "--reload"]