-
Notifications
You must be signed in to change notification settings - Fork 12
/
Dockerfile
43 lines (32 loc) · 1.15 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
35
36
37
38
39
40
41
42
43
FROM python:3.11-slim as python-build
ENV POETRY_VERSION=1.7.1 \
POETRY_HOME="/opt/poetry" \
POETRY_NO_INTERACTION=1
# prepend poetry and venv to path
ENV PATH="$POETRY_HOME/bin:$VENV_PATH/bin:$PATH"
RUN apt-get update \
&& apt-get install --no-install-recommends -y \
curl \
build-essential
# install poetry
RUN curl -sSL https://install.python-poetry.org | python3 -
RUN poetry self add poetry-plugin-export
RUN poetry config warnings.export false
# copy project requirement files here to ensure they will be cached.
WORKDIR /build
COPY poetry.lock pyproject.toml ./
RUN poetry export -f requirements.txt \
--without-hashes \
--without dev \
> requirements.txt
######################################################
FROM python:3.11-slim as app
ENV APP_PATH="/app/grafana-dashboard-manager/"
WORKDIR $APP_PATH
COPY --from=python-build /build/requirements.txt $APP_PATH
COPY --from=python-build /build/pyproject.toml $APP_PATH
COPY README.md $APP_PATH
COPY grafana_dashboard_manager "$APP_PATH/grafana_dashboard_manager"
RUN pip install -r requirements.txt
RUN pip install $APP_PATH
ENTRYPOINT ["python", "grafana_dashboard_manager"]