-
Notifications
You must be signed in to change notification settings - Fork 162
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
42 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,12 @@ | ||
FROM ubuntu | ||
|
||
ENV DEBIAN_FRONTEND "noninteractive" | ||
RUN apt-get update -qq && \ | ||
apt-get install --no-install-recommends --no-install-suggests -y \ | ||
build-essential git python3-pip python3 nginx && pip3 install --no-cache-dir fastapi uvicorn | ||
|
||
RUN git clone https://github.com/laurolins/nanocube.git /nanocube-src | ||
|
||
RUN mkdir /data /www | ||
RUN cp -a /nanocube-src/web/dist/* /www | ||
|
||
WORKDIR nanocube-src | ||
RUN ./configure --with-polycover --prefix=/nanocube && make && make install | ||
|
||
|
||
COPY ./docker-app /app | ||
|
||
#setup a sample /data | ||
|
||
#generate a sample cube | ||
RUN bash -c '/nanocube/bin/nanocube create <(gunzip -c ./data/crime50k.csv.gz) ./data/crime50k.map /data/crime50k.nanocube -header' | ||
|
||
#copy the sample configuration | ||
RUN mv /app/config.json /data | ||
|
||
#cleanup | ||
RUN rm -rf /nanocube-src && \ | ||
apt-get remove --purge -y build-essential git python3-pip && \ | ||
apt-get autoremove -y && apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
|
||
#build | ||
RUN /app/build.sh | ||
|
||
#run | ||
WORKDIR /app | ||
CMD ["/app/run.sh"] | ||
CMD /app/run.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
set -x | ||
|
||
#install dependencies | ||
apt-get update | ||
apt-get install --no-install-recommends --no-install-suggests -y \ | ||
build-essential git nginx ca-certificates | ||
|
||
#apt-get install --no-install-recommends --no-install-suggests -y \ | ||
# python3-pip python3 | ||
#pip3 install --no-cache-dir fastapi uvicorn pandas sqlalchemy | ||
|
||
#clone and build | ||
git clone https://github.com/laurolins/nanocube.git /nanocube-src | ||
cd /nanocube-src | ||
export CXXFLAGS=-O2 | ||
export CFLAGS=-O2 | ||
./configure --with-polycover --prefix=/nanocube | ||
make && make install | ||
|
||
#make sample data directories | ||
mkdir /data /www | ||
cp -a /nanocube-src/web/dist/* /www | ||
#sample web config | ||
mv /app/config.json /data | ||
|
||
#sample nanocube | ||
cd /nanocube-src | ||
bash -c '/nanocube/bin/nanocube create <(gunzip -c ./data/crime50k.csv.gz) ./data/crime50k.map /data/crime50k.nanocube -header' | ||
|
||
#cleanup | ||
rm -rf /nanocube-src | ||
apt-get remove --purge -y build-essential git python3-pip | ||
apt-get autoremove -y && apt-get clean | ||
rm -rf /var/lib/apt/lists/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters