-
Notifications
You must be signed in to change notification settings - Fork 7
/
Dockerfile
43 lines (34 loc) · 1.03 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
# Use the python slim image
FROM python:3.8.3-slim
# Add build deps for python packages
# curl to install vendored poetry
# g++ to build sksurv
RUN apt-get update && \
apt-get install curl g++ -y && \
apt-get clean
# Set the working directory to app
WORKDIR /app
# Set the poetry version explicitly
ENV POETRY_VERSION=1.1.12
# Unbuffer the logger so we always get logs
ENV PYTHONUNBUFFERED=1
# Update the path for poetry python
ENV PATH=/root/.poetry/bin:/root/.local/bin:$PATH
# Install vendored poetry
RUN curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python
# Add dep configs
ADD ./pyproject.toml .
ADD ./poetry.lock .
# Install packages
# Disable virtualenv creation so we just use the already-installed python
RUN poetry config virtualenvs.create false && \
poetry run pip install pip==20.0.2 && \
poetry install && \
rm -r ~/.cache/pip
# Add everything
ADD . .
# Build skgrf
RUN poetry run python buildpre.py
RUN poetry install
# Set the entrypoint to poetry
ENTRYPOINT ["poetry"]