-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
31 lines (24 loc) · 1.06 KB
/
Dockerfile
File metadata and controls
31 lines (24 loc) · 1.06 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
# Dockerfile — Heroku container stack (Dockerfile + heroku.yml)
FROM python:3.12-slim
ENV PIP_DISABLE_PIP_VERSION_CHECK=1 \
PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1
# System libraries required by Chromium + common fonts
RUN apt-get update && apt-get install -y --no-install-recommends \
libglib2.0-0 libnss3 libnspr4 libatk1.0-0 libatk-bridge2.0-0 libcups2 \
libdrm2 libxkbcommon0 libxcomposite1 libxdamage1 libxfixes3 libxrandr2 \
libgbm1 libasound2 fonts-dejavu fonts-liberation wget ca-certificates \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Install Python deps first (better layer caching)
COPY requirements.txt .
RUN pip install -r requirements.txt
# Install Playwright Chromium into a fixed path baked into the image
ENV PLAYWRIGHT_BROWSERS_PATH=/ms-playwright
RUN mkdir -p /ms-playwright && \
python -m playwright install chromium && \
chmod -R a+rX /ms-playwright
# Add application code
COPY . .
# Start the server; Heroku provides $PORT at runtime
CMD ["sh", "-c", "uvicorn app:APP --host 0.0.0.0 --port ${PORT:-8080}"]