Skip to content

Commit

Permalink
Add dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
shirte committed Jan 30, 2025
1 parent 0024c26 commit 8c1a067
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
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, libxau and g++
RUN apk update && apk add libxrender libxext-dev libxau g++

# 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

# create the conda environment
COPY environment.yml .
RUN micromamba env create -f environment.yml

COPY . .

# --mount=type=cache,target=/root/.cache/pip: create a cache directory for pip, so that
# it doesn't have to download the dependencies every time we build the image
RUN --mount=type=cache,target=/root/.cache/pip \
micromamba run -n nerdd_backend pip install .

# --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 nerdd_backend \
python -m nerdd_backend.main --config-name production \
++db.host=$RETHINK_DB_HOST ++db.port=$RETHINK_DB_PORT ++channel.broker_url=$KAFKA_BROKER_URL

0 comments on commit 8c1a067

Please sign in to comment.