How to Deploy from Container Images
Follow the Quickstart instructions for creating a DigitalOcean Container Registry, and push your image to the registry.
Deploy Resource using a Container Image as the Source
- Visit the Apps page and either click Create App if starting from scratch, or click an existing app to add your container image to your solution.
- If adding an image to an existing solution, click the Actions button and choose Create Resources. You can add a Web Service, Worker, or Job.
- Select DigitalOcean Container Registry as the source for your code, choose the image you would like to use from the Repository drop-down and select the tag of the image you would like to deploy.
- Configure resources for your app on the Resources screen.
- Click Scale to select a plan and instance size you would like to use when a container is created from the image.
- Click the edit icon corresponding to the resource to configure details such as HTTP routes, the run command, or the HTTP port. App Platform displays build and run commands that it detected, which you can customize as needed. Refer to the cloud-native buildpacks for instructions for specific buildpacks. For Dockerfile-based builds, entering a run command overrides the Dockerfile’s entrypoint.
- Add new resources such as a service, worker, or static site in the Create Resource section. Select the type of resource in the Resource Type section and click Create. If your app needs a database, you can add a dev database or an existing managed database from your DigitalOcean account. The connection details for your database will be accessible via environment variables so that they can be conveniently accessed in your code.
- If you want to use environment variables, on the Environment screen, click Edit to supply them. Click the Encrypt checkbox to ensure a variable’s value is encrypted in the App Spec.
- Enter a name for your app and choose the region where you’d like your app to be hosted on the Info screen. Click Next.
- The option to select a region is not available for static sites. Static components are served on DigitalOcean’s global CDN.
- Review your app’s resources, environment variables and billing information on the Review screen and then click Create Resources.
When updating the source image tag, a new deployment will be triggered. If the actual tag name has not changed, it is not
guaranteed to pull down a fresh copy of the image due to caching. The recommended approach is to use unique tag names for all
Change the Tag of the Container Source After Deployment
You can change the tag of the container image to use as the source of an existing deployment:
- Visit the Apps page, click your app, and navigate to the Settings tab.
- Click the icon for the resource that you created using a container from your registry.
- Under the Source heading, click the Edit link. Use the Tag drop-down to select the desired tag and re-deploy your app.