diff --git a/Dockerfile b/Dockerfile index 905c6ad..d4d5ec0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,4 +13,4 @@ RUN pip install . --no-cache-dir EXPOSE 8000 -ENTRYPOINT ["panel", "serve", "/app/src/aind_metadata_viz/app.py", "--static-dirs", "images=src/aind_metadata_viz/images", "--port", "8000", "--allow-websocket-origin", "0.0.0.0:8000", "--keep-alive", "10000"] \ No newline at end of file +ENTRYPOINT ["sh", "-c", "panel serve /app/src/aind_metadata_viz/app.py --static-dirs images=src/aind_metadata_viz/images --address 0.0.0.0 --port 8000 --allow-websocket-origin ${ALLOW_WEBSOCKET_ORIGIN} --keep-alive 10000"] \ No newline at end of file diff --git a/README.md b/README.md index e3f4011..a813dde 100644 --- a/README.md +++ b/README.md @@ -45,3 +45,17 @@ nohup panel serve ./src/aind_metadata_viz/app.py --allow-websocket-origin=10.128 ``` The process (should) auto-restart on reboot. See `crontab -e` + +## CI/CD +There is a `Dockerfile` which includes the entrypoint to launch the app. + +### Local dev +1. Build the Docker image locally and run a Docker container: +```sh +docker build -t aind-metadata-viz . +docker run -e ALLOW_WEBSOCKET_ORIGIN=localhost:8000 -p 8000:8000 aind-metadata-viz +``` +2. Navigate to 'localhost:8000` to view the app. + +### Dev +1. On pushes to the `dev` branch, a GitHub Action will run to publish a Docker image to `ghcr.io/allenneuraldynamics/aind-metadata-viz:dev`. \ No newline at end of file