-
Notifications
You must be signed in to change notification settings - Fork 22
Self Hosting With Docker
A Prebuilt Image on DockerHub is available for those who don't want to build the image from scratch.
docker pull tannermiddleton/minimal-chat:latest
building and deploying a Docker image for the application.
- Docker installed on your system
- A
Dockerfile
which should be located in the root of the project directory already - A port number to run the application on (e.g. 8080)
To build the Docker image, navigate to the root of the project directory and run the following command:
docker build -t <image-name> .
Replace <image-name>
with the desired name for your image (e.g. fingerthief/minimal-chat
).
docker build -t fingerthief/minimal-chat .
Once the image is built, you can run the Docker container using the following command:
docker run -p e PORT=<port-number> <port-number>:<port-number> <image-name>
Replace <port-number>
with the port number you want to run the application on (e.g. 8080).
docker run -e PORT=52050 -p 52050:52050 fingerthief/minimal-chat
Once the container is running, you can access the application by navigating to http://localhost:<port-number>
in your web browser.
http://localhost:52050
That's it! You should now have a Docker image built and deployed for your application.
If you encounter any issues during the build or run process, you can check the Docker logs for more information:
docker logs -f <container-id>
Replace <container-id>
with the ID of the running container.