File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- FROM python:3.11-slim
1+ FROM python:3.11-slim AS builder
22
33ENV PYTHONDONTWRITEBYTECODE=1 \
44 PYTHONUNBUFFERED=1
55
6- WORKDIR /app
6+ WORKDIR /build
77
8- RUN apt-get update && apt-get install -y --no-install-recommends libmagic1 && rm -rf /var/lib/apt/lists/*
8+ RUN apt-get update && apt-get install -y --no-install-recommends \
9+ libmagic1 \
10+ gcc \
11+ && rm -rf /var/lib/apt/lists/*
912
1013COPY requirements.txt .
11- RUN pip install --no-cache-dir -r requirements.txt
14+ RUN sed -i 's/\\ $//; s/--hash=.*$//' requirements.txt && \
15+ grep -v '^$\| ^#\| via ' requirements.txt > clean-requirements.txt && \
16+ pip install --no-cache-dir --prefix=/install -r clean-requirements.txt
1217
1318COPY . .
14- RUN pip install --no-cache-dir .
19+ RUN pip install --no-cache-dir --prefix=/install .
20+
21+ FROM python:3.11-slim
22+
23+ ENV PYTHONDONTWRITEBYTECODE=1 \
24+ PYTHONUNBUFFERED=1 \
25+ PATH="/install/bin:$PATH" \
26+ PYTHONPATH="/install/lib/python3.11/site-packages"
27+
28+ WORKDIR /app
29+
30+ RUN apt-get update && apt-get install -y --no-install-recommends \
31+ libmagic1 \
32+ && rm -rf /var/lib/apt/lists/*
33+
34+ COPY --from=builder /install /install
35+ COPY --from=builder /build/app.py /build/main.py /build/config/ /app/
36+ COPY --from=builder /build/extractors/ /app/extractors/
37+ COPY --from=builder /build/core/ /app/core/
38+ COPY --from=builder /build/static/ /app/static/
1539
1640RUN mkdir -p fp/dump fp/organized
1741
You can’t perform that action at this time.
0 commit comments