-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.dev
More file actions
46 lines (36 loc) · 1.13 KB
/
Dockerfile.dev
File metadata and controls
46 lines (36 loc) · 1.13 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
# Development Dockerfile with additional tools
FROM python:3.11-slim
# Set environment variables
ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
UV_LINK_MODE=copy
# Install system dependencies including development tools
RUN apt-get update && apt-get install -y \
curl \
unzip \
git \
vim \
bash-completion \
&& rm -rf /var/lib/apt/lists/*
# Install UV
COPY --from=ghcr.io/astral-sh/uv:latest /uv /bin/uv
# Create app directory
WORKDIR /app
# Copy UV configuration files and README (needed for package metadata)
COPY pyproject.toml ./
COPY README.md ./
# Copy application code
COPY tempfox/ ./tempfox/
# Install dependencies and the package in development mode
RUN uv sync && uv pip install -e .
# Create non-root user and set up UV cache in user home
RUN useradd --create-home --shell /bin/bash tempfox && \
chown -R tempfox:tempfox /app
USER tempfox
ENV UV_CACHE_DIR=/home/tempfox/.cache/uv
# Set up bash completion and aliases
RUN echo 'alias ll="ls -la"' >> ~/.bashrc && \
echo 'alias la="ls -A"' >> ~/.bashrc && \
echo 'alias l="ls -CF"' >> ~/.bashrc
# Default command for development
CMD ["bash"]