forked from flathub-infra/backend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
34 lines (24 loc) · 1.06 KB
/
Dockerfile
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
FROM python:3.9 as builder
RUN apt-get update && \
apt-get install -y --no-install-recommends \
build-essential libcairo2-dev libgirepository1.0-dev \
gir1.2-ostree-1.0 flatpak
RUN curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | /usr/local/bin/python - && \
python -m venv /venv && \
/venv/bin/python -m pip install -U pip
COPY pyproject.toml poetry.lock /
RUN $HOME/.poetry/bin/poetry export -o requirements.txt && \
/venv/bin/pip install -r requirements.txt
FROM python:3.9-slim
ENV PATH="/venv/bin:$PATH"
EXPOSE 8000
RUN apt-get update && \
apt-get install -y --no-install-recommends \
libcairo2 gir1.2-ostree-1.0 flatpak && \
apt-get clean && rm -rf /var/lib/apt/lists/*
RUN flatpak --user remote-add flathub https://flathub.org/repo/flathub.flatpakrepo && \
flatpak --user remote-add flathub-beta https://flathub.org/beta-repo/flathub-beta.flatpakrepo
COPY --from=builder /venv /venv
ADD . /app
WORKDIR /app
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]