When you create an Environment, custom images can be made automatically compatible with Domino Jobs and Workspaces when creating an Environment, as explained in Use external images in Domino Environments. This topic explains how to use additional Dockerfile instructions to enable custom images for use when publishing models or hosting web applications.
-
To do this when creating the Environment, select Customize before building.
-
To add this capability to an existing Environment, click Edit Definition in the top right of the Environment’s overview page.
To publish a Domino model API, install uWSGI and Flask as follows:
# Install uWSGI pre-requisites
RUN apt update && apt install -y --no-install-recommends gcc &&
apt-get clean && rm -rf /var/lib/apt/lists/*
# Add missing library for uWSGI
RUN conda install libpython-static==5.8
ARG LDFLAGS=-fno-lto
ENV LDFLAGS=-fno-lto
# Install Flask & uWSGI
RUN pip install --no-cache-dir Flask Flask-Compress Flask-Cors uwsgi six prometheus-client
Note
|
Replace 5.8 with the specific Python version being used in your Environment.
|
To publish a model API with R, you must also add plumber
and future
to the Environment:
# Make sure R is installed, then add plumber and future
RUN R --no-save -e "install.packages(c('plumber', 'future'))"
The Environment modifications needed to host a web application in Domino depend on the framework you are using; see App publishing.