forked from dylannalex/doc2image
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
40 lines (27 loc) · 1.11 KB
/
Dockerfile
File metadata and controls
40 lines (27 loc) · 1.11 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
# ------------------------------- Builder Stage ------------------------------- #
FROM python:3.13-bookworm AS builder
RUN apt-get update && apt-get install --no-install-recommends -y \
build-essential && \
apt-get clean && rm -rf /var/lib/apt/lists/*
# Download and install UV
ADD https://astral.sh/uv/install.sh /install.sh
RUN chmod -R 655 /install.sh && /install.sh && rm /install.sh
ENV PATH="/root/.local/bin:$PATH"
WORKDIR /app
COPY ./pyproject.toml .
RUN uv venv && uv sync
# ------------------------------- Production Stage ------------------------------- #
FROM python:3.13-slim-bookworm AS production
WORKDIR /app
COPY assets assets
COPY doc2image doc2image
COPY --from=builder /app/.venv .venv
ENV PATH="/app/.venv/bin:$PATH"
ENV DATABASE_URL="sqlite:///data/doc2image.db"
EXPOSE 8000
VOLUME ["/app/data"]
CMD ["python", "-m", "streamlit", "run", "doc2image/ui/app/Home.py", "--server.port=8000"]
# ------------------------------- Metadata ------------------------------- #
LABEL version="1.0"
LABEL description="Turn your documents into stunning AI-generated images."
LABEL maintainer="Dylan Tintenfich"