forked from voxel51/fiftyone
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
132 lines (109 loc) · 3.33 KB
/
Dockerfile
File metadata and controls
132 lines (109 loc) · 3.33 KB
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
# Dockerfile for building an image with a source FiftyOne install atop a
# Debian-based Linux distribution.
#
# By default, Ubuntu 20.04 and Python 3.8 are used, but these can be customized
# via ARGs.
#
# ARGs::
#
# BASE_IMAGE (ubuntu:20.04): The Debian-based image to build from
# PYTHON_VERSION (3.8): The Python version to install
# ROOT_DIR (/fiftyone): The name of the directory within the container that
# should be mounted when running
#
# Example usage::
#
# # Build
# make python
# docker build -t voxel51/fiftyone .
#
# # Run
# SHARED_DIR=/path/to/shared/dir
# docker run \
# -v ${SHARED_DIR}:/fiftyone \
# -p 5151:5151 \
# -it voxel51/fiftyone
#
# Copyright 2017-2022, Voxel51, Inc.
# voxel51.com
#
# The base image to build from; must be Debian-based (eg Ubuntu)
ARG BASE_IMAGE=ubuntu:20.04
FROM $BASE_IMAGE
RUN mkdir -p /Users/dguzman/Documents/GitHub/fiftyone/shared_volume
ARG ROOT_DIR=/Users/dguzman/Documents/GitHub/fiftyone/shared_volume
ENV FIFTYONE_DATABASE_URI=mongodb://host.docker.internal:27017
# The Python version to install
ARG PYTHON_VERSION=3.8
#
# Install system packages
#
RUN apt -y update \
&& apt -y --no-install-recommends install software-properties-common \
&& add-apt-repository -y ppa:deadsnakes/ppa \
&& apt -y update \
&& apt -y upgrade \
&& apt -y --no-install-recommends install tzdata \
&& TZ=Etc/UTC \
&& apt -y --no-install-recommends install \
build-essential \
ca-certificates \
cmake \
cmake-data \
pkg-config \
libcurl4 \
libsm6 \
libxext6 \
libssl-dev \
libffi-dev \
libxml2-dev \
libxslt1-dev \
zlib1g-dev \
unzip \
curl \
wget \
python${PYTHON_VERSION} \
python${PYTHON_VERSION}-dev \
python${PYTHON_VERSION}-distutils \
ffmpeg \
&& ln -s /usr/bin/python${PYTHON_VERSION} /usr/local/bin/python \
&& ln -s /usr/local/lib/python${PYTHON_VERSION} /usr/local/lib/python \
&& curl https://bootstrap.pypa.io/get-pip.py | python \
&& rm -rf /var/lib/apt/lists/*
#
# Install Python dependencies
#
# Other packages you might want:
# torch torchvision: Torch model training/zoo datasets
# tensorflow tensorflow-datasets: TF model training/zoo datasets
# pycocotools: COCO-style evaluation
# notebook>=5.3 ipywidgets>=7.5: Jupyter notebooks
# flash>=0.4: Lightning Flash integration
# apache_beam: Apache Beam integration
# labelbox: Labelbox integration
# shapely: Polyline evaluation
# rasterio: GeoTIFF images
# pydicom: DICOM images
#
RUN pip --no-cache-dir install --upgrade pip setuptools wheel ipython
#
# Install FiftyOne from source
#
COPY dist dist
RUN pip --no-cache-dir install dist/*.whl && rm -rf dist
#
# Configure shared storage
#
# The name of the shared directory in the container that should be
# volume-mounted by users to persist data loaded into FiftyOne
ENV FIFTYONE_DATABASE_URI=mongodb://host.docker.internal:27017 \
FIFTYONE_DATABASE_DIR=${ROOT_DIR}/db \
FIFTYONE_DEFAULT_DATASET_DIR=${ROOT_DIR}/default \
FIFTYONE_DATASET_ZOO_DIR=${ROOT_DIR}/zoo/datasets \
FIFTYONE_MODEL_ZOO_DIR=${ROOT_DIR}/zoo/models
#
# Default behavior
#
# CMD ipython
# Use this if you want the default behavior to instead be to launch the App
CMD python /usr/local/lib/python/dist-packages/fiftyone/server/main.py --port 5151 --address 0.0.0.0