-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
42 lines (32 loc) · 1.62 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
FROM mambaorg/micromamba:2.0.5-alpine3.20
# necessary to display the image on Github
LABEL org.opencontainers.image.source="https://github.com/shirte/nerdd"
USER root
# rdkit requires libxrender, libxext-dev and libxau
# wget is used to download the RDKit installation fix script
# entr is used for live reloading the application
RUN apk update && apk add git libxrender libxext-dev libxau wget entr
# Necessary, so Docker doesn't buffer the output and that we can see the output
# of the application in real-time.
ENV PYTHONUNBUFFERED 1
WORKDIR /app
# Copy only the environment file first, so that we can cache the dependencies
COPY environment.yml .
RUN micromamba env create -f environment.yml
# Fix a problem with the RDKit installation
RUN wget https://gist.githubusercontent.com/shirte/e1734e51dbc72984b2d918a71b68c25b/raw/4a419e6e2b9019e2d6d7d1fa0f9c2a4708c0fc53/rdkit_installation_fix.sh \
&& chmod +x rdkit_installation_fix.sh \
&& ./rdkit_installation_fix.sh cyplebrity
# Copy the rest of the source code directory and install the main package
COPY . .
RUN --mount=type=cache,target=/root/.cache/pip \
micromamba run -n cyplebrity pip install .
RUN --mount=type=cache,target=/root/.cache/pip \
micromamba run -n cyplebrity pip install nerdd-link==0.2.13
# --no-capture-output: output of the application is not buffered and we can see it
# Note: PYTHONUNBUFFERED is not enough, because it only affects the Python
# standard output, not the output of the application.
ENTRYPOINT micromamba run -n cyplebrity \
nerdd_prediction_server cyplebrity.CyplebrityModel \
--broker-url $KAFKA_BROKER_URL \
--data-dir /data