Docker Getting Started (Deployment)
Setting up a Docker Deployment
Once all of the services have been successfully built you'll see the option to Setup a new deployment. You can deploy your app to any of your favorite cloud providers or to your own registered servers.
The first step in the deployment process is to Choose an environment:
In the example below we have a single Rails service. In this case it's been pulled from an image. The previous section of this guide explains how to build images for your services.
The Rails service is a web application so we need to configure it to handle web traffic.
Container Network Configuration
The service will run inside a container, we need to configure it to respond to HTTP traffic. A standard web server listens on port 80 for HTTP traffic and 443 for HTTPS traffic.
A Rails app listens to port 3000 so we should map the container port 3000 to the public Internet ports 80 and 443. Click the connector icon (circled in red above) to update the container port and public internet ports.
Containers can also serve non HTTP traffic. TCP and UDP protocols are also supported. Learn more about Container Port Mapping
Adding Data Sources
The Rails app also needs a database, lets deploy this to a separate MySQL server. First we add another server to the stack and then we should select MySQL as a Data Source
Lets add the MySQL Data Source, you can add as many Data Sources as your app requires.
Now the Rails app is configured to run in a container and we've setup a separate MySQL database server. All that remains is to decide what cloud provider to use and what server size and region we should deploy to.
Remember, you can also deploy to your own servers. However you should first add them as registered servers.
We need to choose a cloud provider for the deployment. For this example we'll use DigitalOcean and deploy the stack to the London region. The server size can be set by clicking on the cog icon displayed at the top right of each server.
Now everything is ready to go, just hit the deploy button. During the build and deployment process you can view the log to see what's happening behind the scenes.
Information that defines how your application is deployed is accessible from manifest.yml. You can edit this file directly if you need to access advanced deployment features. For example advanced configuration of Cross-Origin Resource Sharing or Amazon Virtual Private Cloud and more.