Merge pull request #520 from diego0020/dev-react-proxy

WIP: Use react proxy instead of nginx with cors headers for local dev
This commit is contained in:
Danny Brown 2019-06-18 23:33:37 -04:00 committed by GitHub
commit b3873f7673
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 18 additions and 21 deletions

View File

@ -1,17 +1,6 @@
version: '3.5'
services:
proxy:
image: nginx:1.15-alpine
ports:
- 8899:80
volumes:
- ./config/nginx.conf:/etc/nginx/nginx.conf:ro
restart: unless-stopped
# LINK: https://hub.docker.com/r/jodogne/orthanc-plugins/
# TODO: Update to use Postgres
# https://github.com/mrts/docker-postgresql-multiple-databases
orthanc:
image: jodogne/orthanc-plugins:1.5.6
hostname: orthanc
@ -20,7 +9,7 @@ services:
- ./config/orthanc.json:/etc/orthanc/orthanc.json:ro
# Persist data
- ./volumes/orthanc-db/:/var/lib/orthanc/db/
# ports:
# - '4242:4242' # DICOM
# - '8042:8042' # Web
ports:
- '4242:4242' # DICOM
- '8042:8042' # Web
restart: unless-stopped

View File

@ -29,11 +29,17 @@ For our purposes, we will be using `Orthanc`, but you can see a list of
- Docker
- [Docker for Mac](https://docs.docker.com/docker-for-mac/)
- [Docker for Windows](https://docs.docker.com/docker-for-windows/)
- [Docker for Windows (recommended)](https://docs.docker.com/docker-for-windows/)
- [Docker Toolbox for Windows](https://docs.docker.com/toolbox/toolbox_install_windows/)
_Not sure if you have `docker` installed already? Try running `docker --version`
in command prompt or terminal_
> If you are using `Docker Toolbox` you need to change the _proxy_ parameter in
> _package.json_ to http://192.168.99.100:8042 or the ip docker-machine ip
> throws. This is the value [`react-scripts`][react-proxy] uses to proxy
> requests
### Running Orthanc
_Start Orthanc:_
@ -112,7 +118,7 @@ window.config = {
},
],
},
}
};
```
To learn more about how you can configure the OHIF Viewer, check out our
@ -142,6 +148,7 @@ _Feel free to make a Pull Request if you want to add to this list._
[dicom-web]: https://en.wikipedia.org/wiki/DICOMweb
[storescu]: http://support.dcmtk.org/docs/storescu.html
[cra-start]: https://github.com/facebook/create-react-app#npm-start-or-yarn-start
[react-proxy]: https://facebook.github.io/create-react-app/docs/proxying-api-requests-in-development#configuring-the-proxy-manually
<!-- Archives -->
[dcm4chee]: https://github.com/dcm4che/dcm4chee-arc-light
[dcm4chee-docker]: https://github.com/dcm4che/dcm4chee-arc-light/wiki/Running-on-Docker

View File

@ -13,6 +13,7 @@
"node": ">=8",
"npm": ">=5"
},
"proxy": "http://localhost:8042",
"scripts": {
"cm": "npx git-cz",
"dev": "yarn run preBuild && cross-env PORT=5000 react-scripts start",

View File

@ -5,9 +5,9 @@ window.config = {
dicomWeb: [
{
name: 'Orthanc',
wadoUriRoot: 'http://localhost:8899/wado',
qidoRoot: 'http://localhost:8899/dicom-web',
wadoRoot: 'http://localhost:8899/dicom-web',
wadoUriRoot: '/wado',
qidoRoot: '/dicom-web',
wadoRoot: '/dicom-web',
qidoSupportsIncludeField: false,
imageRendering: 'wadors',
thumbnailRendering: 'wadors',
@ -17,4 +17,4 @@ window.config = {
},
],
},
}
};

View File

@ -17,7 +17,7 @@ export default function initWebWorkers(
if (scriptsPath[scriptsPath.length - 1] !== '/') {
scriptsPath += '/';
}
const config = {
maxWebWorkers: Math.max(navigator.hardwareConcurrency - 1, 1),
startWebWorkersOnDemand: true,