File tree 9 files changed +115
-0
lines changed
9 files changed +115
-0
lines changed Original file line number Diff line number Diff line change
1
+ node_modules
2
+ .circleci
3
+ .prettierrc
4
+ .eslintignore
5
+ .git
6
+ couchdb-data
Original file line number Diff line number Diff line change 1
1
node_modules
2
2
package-lock.json
3
3
config /* .json
4
+ couchdb-data
5
+ .idea
6
+ yarn.lock
Original file line number Diff line number Diff line change
1
+ # docker build -t ohif/dicomweb-server:latest .
2
+ # docker run -p 5985:5985 ohif/dicomweb-server:latest
3
+ # If you want to use PouchDB in this container, add -p 5984:5984
4
+ # docker run -p 5985:5985 -p 5984:5984 -e USE_POUCHDB=true ohif/dicomweb-server:latest
5
+ FROM node:13.10.1-slim
6
+
7
+ # Install prerequisites
8
+ RUN apt-get update
9
+ RUN apt-get -y install git-core \
10
+ supervisor
11
+
12
+ # Grab Source
13
+ RUN mkdir /usr/src/app
14
+ WORKDIR /usr/src/app
15
+ ADD . /usr/src/app
16
+
17
+ # Restore deps
18
+ RUN npm ci
19
+ RUN npm install pouchdb-server
20
+
21
+ # Override config
22
+ COPY ./dockersupport/server-config.js config/development.js
23
+
24
+ # Copy the scripts to run dicomweb-server and PouchDB
25
+ COPY ./dockersupport/dicomweb-server-service.sh /usr/src/dicomweb-server-service.sh
26
+ RUN chmod 777 /usr/src/dicomweb-server-service.sh
27
+
28
+ COPY ./dockersupport/conditionally-start-pouchdb.sh /usr/src/conditionally-start-pouchdb.sh
29
+ RUN chmod 777 /usr/src/conditionally-start-pouchdb.sh
30
+
31
+ ENV USE_POUCHDB=false
32
+
33
+ # Setup Supervisord
34
+ COPY ./dockersupport/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
35
+
36
+ EXPOSE 5984 5985
37
+ CMD ["supervisord" , "-n" ]
Original file line number Diff line number Diff line change
1
+ # docker-compose up
2
+ # curl -X PUT http://127.0.0.1:5984/_users
3
+ # curl -X PUT http://127.0.0.1:5984/_replicator
4
+ # curl -X PUT http://127.0.0.1:5984/_global_changes
5
+ # curl -X PUT http://127.0.0.1:5984/chronicle
6
+ # http://localhost:5984/_utils/
7
+ version : ' 3.8'
8
+
9
+ services :
10
+ dicomweb :
11
+ build :
12
+ context : .
13
+ dockerfile : Dockerfile
14
+ image : ohif/dicomweb-server:latest
15
+ hostname : dicomweb-server
16
+ environment :
17
+ - PORT=5984
18
+ ports :
19
+ - ' 5985:5985'
20
+ depends_on :
21
+ - couchdb
22
+ restart : unless-stopped
23
+
24
+ # #
25
+ # LINK: https://hub.docker.com/_/couchdb
26
+ # #
27
+ couchdb :
28
+ image : couchdb:2.3.1
29
+ hostname : couchdb
30
+ volumes :
31
+ - ./couchdb-data:/opt/couchdb/data
32
+ ports :
33
+ - ' 5984:5984'
34
+ restart : unless-stopped
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ if [ $USE_POUCHDB = " true" ]
4
+ then
5
+ echo " USE_POUCHDB is true, starting PouchDB service"
6
+ /usr/src/app/node_modules/pouchdb-server/bin/pouchdb-server --in-memory --host 0.0.0.0
7
+ else
8
+ exit 0
9
+ fi
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ cd /usr/src/app
3
+ npm start
Original file line number Diff line number Diff line change
1
+ module . exports = {
2
+ env : process . env . NODE_ENV ,
3
+ dbServer : process . env . USE_POUCHDB === 'true' ? 'http://0.0.0.0' : 'http://couchdb' ,
4
+ db : 'chronicle' ,
5
+ dbPort : process . env . PORT || 5984 ,
6
+ auth : 'none' ,
7
+ logger : true ,
8
+ } ;
Original file line number Diff line number Diff line change
1
+ [supervisord]
2
+ nodaemon=true
3
+
4
+ [program:pouchdb]
5
+ command=bash /usr/src/conditionally-start-pouchdb.sh
6
+ stdout_logfile=/var/log/supervisor/%(program_name)s.log
7
+ stderr_logfile=/var/log/supervisor/%(program_name)s.log
8
+ autorestart=true
9
+
10
+ [program:dicomweb-server]
11
+ command=bash /usr/src/dicomweb-server-service.sh
12
+ stdout_logfile=/var/log/supervisor/%(program_name)s.log
13
+ stderr_logfile=/var/log/supervisor/%(program_name)s.log
14
+ autorestart=true
Original file line number Diff line number Diff line change 2
2
"name" : " dicomweb-server" ,
3
3
"version" : " 0.0.0-development" ,
4
4
"description" : " Lightweight DICOMweb Server with CouchDB" ,
5
+ "repository" : " https://github.com/dcmjs-org/dicomweb-server" ,
5
6
"main" : " server.js" ,
6
7
"dependencies" : {
7
8
"atob" : " ^2.1.2" ,
You can’t perform that action at this time.
0 commit comments