Expose Service Port
Last updated
Was this helpful?
Last updated
Was this helpful?
In Docker, you can specify the HTTP ports you want to expose by configuring port publishing using the format HOST_PORT:CONTAINER_PORT. This configuration forwards requests sent to HOST_PORT to the containerโs program listening on CONTAINER_PORT.
When deploying your Docker program to Phala TEE Cloud, the process remains the same. You should specify the port mapping in the Docker Compose file using the ports field, as shown below, we expose the port 8000 to the port 80 on the host for httpbin service and the port 8001 to the port 5432 on the host for postgres service.
[!NOTE] The environment variable value need to be set through Secure Environment Variables in the dashboard. Here we set the
POSTGRES_PASSWORD
topostgres
.
After deployment, you will see two public endpoints on the dashboard, one for httpbin service and the other for postgres service. These URLs can be used to publicly access the service running in Docker. Behind the scenes, our cloud platform parses the Docker Compose file and automatically configures the network forwarding.
If you can access the service, it means you've successfully migrated your application into a TEE. Next step is to generate a RA report to prove the integrity of your application.