-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
42 lines (28 loc) · 868 Bytes
/
Dockerfile
File metadata and controls
42 lines (28 loc) · 868 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
FROM python:3.12.3-alpine AS base
WORKDIR /app
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
VIRTUAL_ENV="/opt/venv"
RUN python3 -m venv $VIRTUAL_ENV
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
FROM base AS base_app
COPY requirements.txt .
RUN --mount=type=cache,target=/root/.cache/pip pip install -U pip \
&& pip install -r requirements.txt \
&& rm requirements.txt
FROM base_app AS monkey_app
COPY src/ .
ARG BUILD_TIMESTAMP
ENV BUILD_TIMESTAMP=$BUILD_TIMESTAMP
FROM base_app AS base_tests
COPY requirements-tests.txt .
RUN --mount=type=cache,target=/root/.cache/pip pip install -U pip \
&& pip install setuptools \
&& pip install -r requirements-tests.txt \
&& rm requirements-tests.txt
COPY pytest.ini .
FROM base_tests AS monkey_tests
COPY src/ .
COPY tests/ tests/
ARG BUILD_TIMESTAMP
ENV BUILD_TIMESTAMP=$BUILD_TIMESTAMP