-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathDockerfile
More file actions
40 lines (24 loc) · 862 Bytes
/
Dockerfile
File metadata and controls
40 lines (24 loc) · 862 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
FROM python:3.8-slim AS base
LABEL version="1.0" maintainer="Alejandro Menor <alex4menor@gmail.com>"
FROM base AS builder
RUN apt update && \
apt install -y --no-install-recommends build-essential
RUN pip install poetry
RUN python -m venv /venv
COPY pyproject.toml poetry.lock ./
RUN poetry export -f requirements.txt --dev | /venv/bin/pip install -r /dev/stdin
FROM base AS final
RUN apt update && apt install make -y --no-install-recommends
RUN groupadd -r tests && useradd --no-log-init -r -g tests tests
USER tests
ENV PATH="/venv/bin:$PATH"
ARG NUM_OF_WATCHABLES_PER_SESSION=20
ARG MAX_USERS_PER_SESSION=8
ARG MODE=dev
ENV NUM_OF_WATCHABLES_PER_SESSION=$NUM_OF_WATCHABLES_PER_SESSION
ENV MAX_USERS_PER_SESSION=$MAX_USERS_PER_SESSION
ENV MODE=$MODE
COPY --from=builder /venv /venv
WORKDIR /test
VOLUME /test
CMD ["python", "-m", "pytest"]