forked from zauberzeug/nicegui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fly.dockerfile
36 lines (22 loc) · 1.05 KB
/
fly.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
35
36
FROM python:3.11.3-slim
LABEL maintainer="Zauberzeug GmbH <[email protected]>"
RUN pip install itsdangerous prometheus_client isort docutils pandas plotly matplotlib requests
RUN apt update && apt install -y curl
RUN curl -sSL https://install.python-poetry.org | python3 - && \
cd /usr/local/bin && \
ln -s ~/.local/bin/poetry && \
poetry config virtualenvs.create false
WORKDIR /app
COPY pyproject.toml poetry.lock* ./
RUN poetry install --no-root --extras "plotly matplotlib"
ADD . .
# ensure unique version to not serve cached and hence potentially wrong static files
ARG VERSION=unknown
RUN if [ "$VERSION" = "unknown" ]; then echo "Error: VERSION build argument is required. Use: fly deploy --build-arg VERSION=$(git describe --abbrev=0 --tags --match 'v*' 2>/dev/null | sed 's/^v//' || echo '0.0.0')" && exit 1; fi
RUN sed -i "/\[tool.poetry\]/,/]/s/version = .*/version = \"$VERSION\"/" pyproject.toml
RUN pip install .
EXPOSE 8080
EXPOSE 9062
COPY fly-entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
CMD ["python", "main.py"]