-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathDockerfile.tests
36 lines (35 loc) · 1.41 KB
/
Dockerfile.tests
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-bullseye as builder
RUN groupadd --gid 1000 renku && \
useradd --gid 1000 --uid 1000 --groups 100 --create-home renku && \
mkdir -p /app && \
chown -R 1000:1000 /app
USER 1000:1000
WORKDIR /app
RUN python3 -m pip install --user pipx && \
python3 -m pipx ensurepath && \
/home/renku/.local/bin/pipx install poetry && \
python3 -m venv .venv && \
python3 -m venv .renku-venv
COPY poetry.lock pyproject.toml ./
RUN /home/renku/.local/bin/poetry export --only main --without-hashes -o requirements.txt && \
.venv/bin/pip install -r requirements.txt --prefer-binary
RUN /home/renku/.local/bin/poetry export --with dev --without-hashes -o requirements_dev.txt && \
.venv/bin/pip install -r requirements_dev.txt --prefer-binary && \
.renku-venv/bin/pip install renku
FROM python:3.11-slim-bullseye
RUN apt-get update && apt-get install -y \
tini git git-lfs && \
rm -rf /var/lib/apt/lists/* && \
groupadd --gid 1000 renku && \
useradd --gid 1000 --uid 1000 --groups 100 --create-home renku && \
mkdir -p /app && \
chown -R 1000:1000 /app
USER 1000:1000
WORKDIR /app
COPY --from=builder /app/.venv .venv
COPY --from=builder /app/.renku-venv .renku-venv
ENV PATH=$PATH:/app/.venv/bin:/app/.renku-venv/bin
COPY renku_notebooks renku_notebooks
COPY resource_schema_migrations resource_schema_migrations
COPY tests tests
CMD [".venv/bin/pytest", "-v", "tests/integration"]