Deploying a Service via Docker#
The apex server is set up to be able to run docker containers. This allows us to deploy services that should be isolated from the rest of the system, and always be available (within the tailscale VPN).
Prerequisites#
- Make sure the user that you are deploying the service to is in the
dockergroup. If you are not sure how to do this, you can follow the guide on creating a new user. - Make sure your machine is connected to the tailscale VPN, since the deployment is done via SSH.
- Make sure the image you want is in Docker Hub or any other registry.
Deploying a Service#
To deploy a service, all you need to do is run the following command:
where<username> is the username of the user you are deploying the service to.
This will do the exact same thing as running docker compose up on your local machine, but it will do it via SSH on the apex server.
Connecting to the Service#
To connect to the service once deployed, navigate to the mapped port on the apex server. For example, if you have a service running at localhost:8080, you can connect to it by navigating to http://apex:8080 in your browser.
Tip
While you can connect to http://apex:8080, you can also connect to http://apex.tailcdd45f.ts.net:8080 if you want to be more explicit that you are connecting via tailscale and that you need to be connected to the VPN.