-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
50 lines (39 loc) · 1.08 KB
/
Dockerfile
File metadata and controls
50 lines (39 loc) · 1.08 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
47
48
49
50
# syntax=docker/dockerfile:1
# Use a slim Python image
FROM python:3.13-slim
# Set working directory
WORKDIR /app
# Install system deps for building wheels and PyMuPDF dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
libjpeg-dev \
zlib1g-dev \
libfreetype6-dev \
libopenjp2-7-dev \
liblcms2-dev \
libtiff5-dev \
libharfbuzz-dev \
libfribidi-dev \
ghostscript \
&& rm -rf /var/lib/apt/lists/*
# Copy requirements first for layer caching
COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt
# Copy application code
COPY . .
# Make entrypoint script executable
RUN chmod +x docker-entrypoint.sh fix_migrations.py
# Create data directory (for db and uploads)
RUN mkdir -p /app/data/uploads
# Expose application port
EXPOSE 2278
# Environment defaults
ENV PORT=2278 \
HOST=0.0.0.0 \
RELOAD=false \
ALLOW_REGISTRATION=true \
AUTO_FIX_MIGRATIONS=true
# Use entrypoint script
ENTRYPOINT ["/app/docker-entrypoint.sh"]
# Default command
CMD ["python", "-m", "app.main"]