Update content

How to deploy a container

Published on 26 May 2021

This page shows you how to deploy your first Serverless Container. A container is a package of software that includes all dependencies: code, runtime, configuration, and system libraries so that it can run on any host system. This allows you to control your production environment. Scaleway provides you with custom Docker images that are entirely handled for you in the cloud. With Serverless Containers, you can rely on your favorite technologies such as Django or Ruby On Rails.

Identity and Access Management (IAM):

If you have activated IAM, you may need certain IAM permissions to carry out some actions described on this page. This means:

  • you are the Owner of the Scaleway Organization in which the actions will be carried out, or
  • you are an IAM user of the Organization, with a policy granting you the necessary permission sets
Requirements:

You can deploy a container either from the Scaleway Container Registry or from any other public container registry (DockerHub, AWS Container registries, Gitlab container registry, etc.).

Deploy from the Scaleway Container Registry

  1. Click Containers in the Serverless section of the side menu. The containers page displays.
  2. Click the relevant containers namespace.
  3. Click Deploy a Container. The container creation wizard displays.
  4. Complete the following steps in the wizard:
    • Select the Scaleway Container Registry.
    • Choose an image from your Container Registry. Select the required Container Registry Namespace from the dropdown list, and then select the container and tag.
    • Choose the Port your container is listening on. We recommend configuring your container to listen on the PORT environment variable.
    • Choose a name for your container, and optionally a description. The name must only contain alphanumeric characters.
    • Choose the resources to be allocated to your container at runtime. These define the performance characteristics of your container.
    • Set your scaling preferences, or leave them at default values. The Scaleway platform autoscales the number of available instances of your container to match the incoming load, depending on the settings you define here.
    • Define any environment variables you want to inject into your container. For each environment variable, click +Add and enter the key/value pair.
    • Add secrets for your container. Secrets are are environment variables which are injected into your function, but the values are not retained or displayed by Scaleway after initial validation.
    • Set the desired privacy policy for your container. This defines whether container invocation may be done anonymously (public) or only via an authentication mechanism provided by the Scaleway API (private).
    • Optionally, use the advanced options to add triggers to your container deployment. Adding triggers enables the container to handle events coming from sources other than an HTTP endpoint, such as CRON (time-based jobs), MQTT queues and more.
    • Verify the estimated cost.
  5. Click Deploy a container to finish.

Deploy from an external Registry

  1. Click Containers in the Serverless section of the side menu. The containers page displays.
  2. Click the relevant containers namespace.
  3. Click Deploy a Container. The container creation wizard displays.
  4. Complete the following steps in the wizard:
    • Select the External container registry.
    • Enter the public container image URL provided by the external registry.
    • Choose the Port your container is listening on. We recommend configuring your container to listen on the PORT environment variable.
    • Choose a name for your container, and optionally a description. The name must only contain alphanumeric characters.
    • Choose the resources to be allocated to your container at runtime. These define the performance characteristics of your container.
    • Set your scaling preferences, or leave them at default values. The Scaleway platform autoscales the number of available instances of your container to match the incoming load, depending on the settings you define here.
    • Define any environment variables you want to inject into your container. For each environment variable, click +Add and enter the key/value pair.
    • Add secrets for your container. Secrets are are environment variables which are injected into your function, but the values are not retained or displayed by Scaleway after initial validation.
    • Set the desired privacy policy for your container. This defines whether container invocation may be done anonymously (public) or only via an authentication mechanism provided by the Scaleway API (private).
    • Optionally, use the advanced options to add triggers to your container deployment. Adding triggers enables the container to handle events coming from sources other than an HTTP endpoint, such as CRON (time-based jobs), MQTT queues and more.
    • Verify the estimated cost.
  5. Click Deploy a container to finish.