diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000000..382e9fb739 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,6 @@ +FROM node:4.3.2 +ADD package.json /src/package.json +RUN cd /src && npm install +ADD . /src +WORKDIR /src +ENTRYPOINT ["npm", "start", "--"] \ No newline at end of file diff --git a/README.md b/README.md index 2f0d942b23..1df8064cf3 100644 --- a/README.md +++ b/README.md @@ -78,6 +78,30 @@ If you want to require a username and password to access the dashboard, you can HTTPS and Basic Auth are mandatory if you are accessing the dashboard remotely instead of accessing it from `localhost`. +## Run with Docker + +It is easy to use it with Docker. First build the image: + +``` +docker build -t parse-dashboard . +``` + +Run the image with your ``config.json`` mounted as a volume + +``` +docker run -d -p 8080:4040 -v host/path/to/config.json:/src/Parse-Dashboard/parse-dashboard-config.json parse-dashboard +``` + +By default, the container will start the app at port 4040 inside the container. However, you can run custom command as well (see ``Deploying in production`` for custom setup). + +In this example, we want to run the application in production mode at port 80 of the host machine. + +``` +docker run -d -p 80:8080 -v host/path/to/config.json:/src/Parse-Dashboard/parse-dashboard-config.json parse-dashboard --port 8080 +``` + +If you are not familiar with Docker, ``--port 8080`` with be passed in as argument to the entrypoint to form the full command ``npm start -- --port 8080``. The application will start at port 8080 inside the container and port ``8080`` will be mounted to port ``80`` on your host machine. + ## Deploying in production If you're deploying to a provider like Heroku, or Google App Engine, the SSL endpoint is terminated early and handled by the provider and you may encounter this error `Parse Dashboard can only be remotely accessed via HTTPS`.