forked from NVIDIA/GenerativeAIExamples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
executable file
·73 lines (55 loc) · 2.35 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# syntax=docker/dockerfile:1.3
# SPDX-FileCopyrightText: Copyright (c) 2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
ARG MORPHEUS_CONTAINER=nvcr.io/nvidia/morpheus/morpheus
ARG MORPHEUS_CONTAINER_VERSION=v24.03.00-dev
FROM ${MORPHEUS_CONTAINER}:${MORPHEUS_CONTAINER_VERSION} as base
WORKDIR /workspace
# # Use a separate build directory to avoid clashes on the host
# ENV BUILD_DIR=build-docker
# Make it easier to run commands in the container
ENV SHELL=/bin/bash
# Copy over just the environment file to install the dependencies without busting the cache from source file changes
COPY ./requirements.yaml .
# Install the example's dependencies
RUN source activate morpheus \
&& mamba env update -n morpheus -f ./requirements.yaml
# Copy everything over to the container to build
COPY . ./
RUN chmod +x /workspace/entrypoint.sh
# # If any changes have been made from the base image, recopy the sources
# COPY ./examples/cyber_dev_day /workspace/examples/cyber_dev_day/
# ===== Setup for running unattended =====
FROM base as runtime
# # Install the Workflow package
# RUN source activate morpheus \
# && pip install -e .
# # Keep the container running indefinitely
# CMD ["sleep", "infinity"]
# ===== Setup for running Jupyter =====
FROM base as jupyter
# Install the jupyter specific requirements
RUN source activate morpheus &&\
mamba install -y -c conda-forge \
ipywidgets \
jupyter_contrib_nbextensions \
# notebook v7 is incompatible with jupyter_contrib_nbextensions
notebook=6 &&\
jupyter contrib nbextension install --user &&\
pip install jupyterlab_nvdashboard==0.9
RUN source activate morpheus &&\
pip install langchain-nvidia-ai-endpoints==0.2.2
# Launch jupyter
CMD ["jupyter-lab", "--ip=0.0.0.0", "--no-browser", "--allow-root"]