forked from stevenewey/octograph
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile
35 lines (25 loc) · 822 Bytes
/
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
######### BASE Image #########
FROM python:3.12-slim AS base
LABEL maintainer="Iain Rauch <[email protected]>"
ARG APP_NAME=octograph
ARG VERSION=dev
ENV APP_NAME=${APP_NAME}
ENV VERSION=${VERSION}
ENV POETRY_VIRTUALENVS_CREATE=false \
POETRY_NO_INTERACTION=1 \
PIP_ROOT_USER_ACTION=ignore
RUN mkdir -p "/opt/$APP_NAME"
WORKDIR "/opt/$APP_NAME"
RUN python -m pip install --no-cache-dir --upgrade pip poetry wheel
COPY poetry.lock pyproject.toml ./
COPY app app
RUN poetry install --only main --no-root
######### TEST Image #########
FROM base AS test
COPY tests tests
RUN poetry install
RUN poetry run pytest -v tests/unit
######### PRODUCTION Image #########
FROM base AS production
RUN poetry install --only main
ENTRYPOINT ["python", "/opt/octograph/app/octopus_to_influxdb.py"]