forked from b1n4ryj4n/koreader-sync
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
49 lines (31 loc) · 934 Bytes
/
Copy pathDockerfile
File metadata and controls
49 lines (31 loc) · 934 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
40
41
42
43
44
45
46
47
48
49
FROM python:3.11-slim AS builder
RUN apt-get update && apt-get install -y \
build-essential \
libpq-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
RUN mkdir /app
RUN mkdir /app/data
WORKDIR /app
COPY requirements.txt .
ENV PYTHONDONTWRITEBYTECODE 1
RUN python3 -m pip install --user --no-cache-dir --upgrade \
pip \
setuptools \
wheel
RUN python3 -m pip install --user --no-cache-dir \
-r requirements.txt
FROM python:3.11-slim
RUN apt-get update && apt-get install -y \
curl \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
ENV PYTHONUNBUFFERED 1
WORKDIR /app
COPY --from=builder /root/.local /root/.local
COPY kosync.py .
EXPOSE 8081
VOLUME ["/app/data"]
ENV PATH=/root/.local/bin:$PATH
HEALTHCHECK --interval=30s --timeout=10s CMD curl --fail http://localhost:8081/healthstatus || exit 1
CMD ["uvicorn", "kosync:app", "--host", "0.0.0.0", "--port", "8081"]