-
Notifications
You must be signed in to change notification settings - Fork 209
Expand file tree
/
Copy pathDockerfile
More file actions
43 lines (33 loc) · 937 Bytes
/
Dockerfile
File metadata and controls
43 lines (33 loc) · 937 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
37
38
39
40
41
42
43
# FitTrack API Dockerfile
# Development image with hot-reload support
FROM python:3.12-slim
# Set environment variables
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
PYTHONPATH=/app/src \
PIP_NO_CACHE_DIR=1 \
PIP_DISABLE_PIP_VERSION_CHECK=1
# Install system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
libaio1 \
curl \
&& rm -rf /var/lib/apt/lists/*
# Create app directory
WORKDIR /app
# Copy dependency files
COPY pyproject.toml ./
# Install Python dependencies
RUN pip install --upgrade pip && \
pip install -e ".[dev]"
# Copy source code
COPY src/ ./src/
COPY tests/ ./tests/
# Create non-root user
RUN useradd --create-home --shell /bin/bash fittrack && \
chown -R fittrack:fittrack /app
USER fittrack
# Expose port
EXPOSE 8000
# Default command
CMD ["uvicorn", "fittrack.main:app", "--host", "0.0.0.0", "--port", "8000"]