-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updated to use docker-compose for fully local development environment
- Loading branch information
Soichi Hayashi
committed
Aug 24, 2022
1 parent
55c3fff
commit b0b1539
Showing
21 changed files
with
3,130 additions
and
79 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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
ui | ||
handler | ||
workdir | ||
test | ||
bids-specification |
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,9 @@ | ||
FROM node:16 | ||
|
||
COPY . /app | ||
|
||
WORKDIR /app | ||
RUN npm install -g pm2 typescript | ||
|
||
RUN npm install | ||
|
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
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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
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,4 @@ | ||
#!/bin/bash | ||
|
||
tsc --watch & | ||
pm2 start ezbids.js --attach --watch --ignore-watch="*.log test *.sh ui bin example .git **/*.ts" |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,16 @@ | ||
#!/bin/bash | ||
|
||
set -ex | ||
|
||
git submodule update --init --recursive | ||
|
||
(cd api && npm install) | ||
(cd ui && npm install) | ||
|
||
mkdir -p /tmp/upload | ||
mkdir -p /tmp/workdir | ||
|
||
#docker-compose up --build | ||
docker-compose up | ||
|
||
|
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,67 @@ | ||
version: "3" | ||
|
||
services: | ||
|
||
mongodb: | ||
image: mongo:4.4.15 | ||
volumes: | ||
- /data/db | ||
healthcheck: | ||
test: echo 'db.runCommand("ping").ok' | mongo localhost:27017/test --quiet | ||
interval: 10s | ||
timeout: 10s | ||
retries: 5 | ||
ports: | ||
- 27417:27017 #for local debuggin | ||
|
||
api: | ||
build: . | ||
volumes: | ||
- ./api:/app/api | ||
- /tmp:/tmp | ||
depends_on: | ||
mongodb: | ||
condition: service_healthy | ||
healthcheck: | ||
test: ["CMD", "curl", "-f", "http://localhost:8080/health"] | ||
working_dir: /app/api | ||
command: ./dev.sh | ||
ports: | ||
- 8082:8080 | ||
|
||
handler: | ||
build: ./handler | ||
volumes: | ||
- .:/app | ||
- /tmp:/tmp | ||
depends_on: | ||
mongodb: | ||
condition: service_healthy | ||
tty: | ||
true #turn on color for bids-validator output | ||
command: pm2 start handler.js --attach --watch --ignore-watch "ui **/node_modules" | ||
|
||
ui: | ||
build: ./ui | ||
volumes: | ||
- ./ui/src:/ui/src #don't copy node_modules which might be compiled for mac (vite won't work) | ||
environment: | ||
VITE_APIHOST: http://localhost:8082 | ||
healthcheck: | ||
test: ["CMD", "curl", "-f", "http://localhost:3000"] | ||
ports: | ||
- 3000:3000 | ||
|
||
# nginx: | ||
# image: nginx:1.18 | ||
# depends_on: | ||
# api: | ||
# condition: service_healthy | ||
# ui: | ||
# condition: service_healthy | ||
# volumes: | ||
# - ./config/nginx/nginx.conf:/etc/nginx/nginx.conf | ||
# ports: | ||
# - 8082:80 | ||
|
||
|
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,5 +1,3 @@ | ||
#FROM ubuntu:20.04 | ||
#FROM brainlife/fsl-mini:6.0.3 | ||
FROM neurodebian:nd20.04-non-free | ||
|
||
ENV DEBIAN_FRONTEND noninteractive | ||
|
@@ -28,18 +26,22 @@ RUN . $FSLDIR/etc/fslconf/fsl.sh | |
ENV FSLOUTPUTTYPE=NIFTI_GZ | ||
|
||
#make sure fslpython is properly installed | ||
RUN which imcp | ||
#RUN which imcp | ||
|
||
RUN apt install -y curl | ||
RUN curl -fsSL https://deb.nodesource.com/setup_14.x | bash - | ||
RUN apt install -y nodejs | ||
|
||
# Get dcm2niix from github and compile | ||
RUN cd /tmp && \ | ||
git clone https://github.com/rordenlab/dcm2niix.git -b v1.0.20211006 && \ | ||
cd dcm2niix && mkdir build && cd build && \ | ||
cmake -DBATCH_VERSION=ON -DUSE_OPENJPEG=ON .. && \ | ||
make && make install | ||
#RUN cd /tmp && \ | ||
# git clone https://github.com/rordenlab/dcm2niix.git -b v1.0.20211006 && \ | ||
# cd dcm2niix && mkdir build && cd build && \ | ||
# cmake -DBATCH_VERSION=ON -DUSE_OPENJPEG=ON .. && \ | ||
# make && make install | ||
|
||
RUN wget https://github.com/rordenlab/dcm2niix/releases/download/v1.0.20220720/dcm2niix_lnx.zip -O /tmp/dcm2niix_lnx.zip | ||
RUN unzip /tmp/dcm2niix_lnx.zip | ||
RUN mv dcm2niix /usr/local/bin | ||
|
||
# Get bids-specification from github | ||
RUN cd && git clone https://github.com/bids-standard/bids-specification | ||
|
@@ -51,7 +53,9 @@ RUN pip3 install numpy nibabel pandas==1.0.1 matplotlib pyyaml==5.4.1 natsort #n | |
RUN pip3 install quickshear | ||
|
||
#install ROBEX | ||
COPY ROBEXv12.linux64.tar.gz / | ||
#COPY ROBEXv12.linux64.tar.gz / | ||
ADD https://www.nitrc.org/frs/download.php/5994/ROBEXv12.linux64.tar.gz//?i_agree=1&download_now=1 / | ||
RUN ls -la | ||
RUN tar -xzf /ROBEXv12.linux64.tar.gz | ||
ENV PATH=$PATH:/ROBEX | ||
|
||
|
@@ -61,8 +65,11 @@ RUN pip3 install pydeface | |
RUN rm /bin/sh && ln -s /bin/bash /bin/sh | ||
|
||
#install bids-validator | ||
RUN npm install -g [email protected].3 | ||
RUN npm install -g [email protected].6 | ||
|
||
RUN apt-get install -y rename zstd | ||
|
||
WORKDIR /app/handler | ||
RUN npm install -g pm2 #for dev | ||
|
||
|
This file was deleted.
Oops, something went wrong.
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,8 @@ | ||
FROM node:16 | ||
|
||
COPY . /ui | ||
WORKDIR /ui | ||
|
||
RUN npm install | ||
|
||
CMD [ "npm", "run", "dev" ] |
Oops, something went wrong.