-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
39 lines (30 loc) · 873 Bytes
/
Dockerfile
File metadata and controls
39 lines (30 loc) · 873 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
FROM python:3.12-slim
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1
# Install LibreOffice and fonts
RUN apt-get update && apt-get install -y --no-install-recommends \
libreoffice \
fonts-dejavu-core \
fonts-noto \
fonts-noto-cjk \
fonts-noto-cjk-extra \
fonts-noto-color-emoji \
fonts-wqy-microhei \
fonts-wqy-zenhei \
fontconfig \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY requirements.txt /app/
RUN pip install --no-cache-dir -r requirements.txt
COPY app /app/app
# Directories for data and logs
RUN mkdir -p /tmp/o2pdata /tmp/o2plog
# Default environment variables
ENV APIKEY=changeme \
CONVERT_TIMEOUT=600 \
MAX_CONCURRENCY=2 \
CLEANUP_AFTER_SECONDS=3600 \
LOG_DIR=/tmp/o2plog \
DATA_DIR=/tmp/o2pdata
EXPOSE 8000
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]