Skip to content

Commit 5a73858

Browse files
committed
Updated Dockerfile
1 parent 17a8232 commit 5a73858

1 file changed

Lines changed: 7 additions & 12 deletions

File tree

Dockerfile

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,27 @@
1-
# 1. Base image
1+
# 1. Use slim base image
22
FROM python:3.11-slim
33

44
# 2. Working directory
55
WORKDIR /app
66

77
# 3. Install system dependencies
88
RUN apt-get update && apt-get install -y --no-install-recommends \
9-
build-essential \
10-
libjpeg-dev \
11-
libpng-dev \
12-
libfreetype6-dev \
13-
pkg-config \
14-
&& apt-get clean \
15-
&& rm -rf /var/lib/apt/lists/*
9+
gcc \
10+
&& rm -rf /var/lib/apt/lists/*
1611

1712
# 4. Install Python dependencies
1813
COPY requirements.txt .
1914
RUN pip install --upgrade pip \
2015
&& pip install --no-cache-dir -r requirements.txt
2116

22-
# 5. Copy project files
17+
# 5. Copy application code
2318
COPY . .
2419

25-
# 6. Set environment variables
20+
# 6. Environment settings
2621
ENV PYTHONUNBUFFERED=1
2722

28-
# 7. Expose port
23+
# 7. Expose FastAPI port
2924
EXPOSE 8000
3025

31-
# 8. Run app
26+
# 8. Launch the app
3227
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]

0 commit comments

Comments
 (0)