Configuring your app using environment variables

Environment variables are a powerful way to configure your application's runtime settings. They allow you to provide dynamic and flexible configuration options to your application without hardcoding values within your code.

What you'll need

Before you dive in, make sure you have the following prerequisites in place:

  • A bunny.net account ( Log in or sign up for a free trial).
  • To configure your application using environment variables, you must have the required environment variables already defined and set up. 

Environment variables configuration

When you select a registry image and specify the container type, Magic Containers initiates a scan of the image. During this scan, the system inspects image metadata and any associated configuration files to identify environment variables that the container might use. This scanning feature is currently supported only for public Docker Hub images. If the scan is successful, the environment variables are displayed in a dedicated list, which includes their names and any available default values or descriptions.

By clicking Go To Environment Variables button, you can easily add all the variables right away with a single click.

This eliminates the need to copy and paste variable names or values manually. By automating the discovery and insertion process, Magic Containers helps minimize human error and makes the initial setup phase faster.

If Magic Containers does not detect any variables in the image, you can still configure your environment variables manually. To configure your application using environment variables, you'll need to follow these steps:

  1. Login to bunny.net dashboard .

  2. Click Magic Containers and locate the container for which you want to configure environment variables.

  3. Click Container Settings and click Edit.

  4. Select the Environment Variables tab and click + Add New Variable.

  1. Specify the Name and Default Value of the variable and click + Add New Variable. Click Update Container.

Congratulations! You have successfully set up your environment variable.

Need help or encountering issues?

If you encounter any difficulties or have questions while following this Quickstart Guide, our support team is here to assist you. Please don't hesitate to contact us via support request form for prompt assistance.

Our dedicated support team is ready to help you resolve any issues you might face during the deployment process, provide additional guidance, or answer your questions.