Envs
Self-host your envs
Deploying Environments (Docker)
An environment represents a space for modifying code or content. It stores files and their changes, and communicates with Git to download files and publish changes.
To simplify the deployment process, we offer a Docker strategy for publishing images.
In the admin, create a local environment before deploying and capture the
environment name (DECO_ENV_NAME
).
Dockerfile
To deploy in Docker, create and publish the Dockerfile below. No additional files are needed, except for the Git keys to be used in the project.
The Git key is necessary for the image to publish changes. In the example below, we will use two files:
ssh/id_ed25519
: generated private keyssh/id_ed25519.pub
: public key associated with the private key above and the Git repository
Additionally, we have variables that can be changed according to your needs:
DECO_ENV_NAME
: Name of the environment added in the adminDECO_SITE_NAME
: Project nameDECO_REPO_URL
: SSH access URL to your Git repository
Deploy Docker
To create the Docker image based on your project, run the following command in the root directory:
docker build -t env_image .
Finally, create and run the Docker container:
docker run -p 8000:8000 --name env_container env_image
With this, your environment will be running in a Docker container, ready for use.
Important Considerations
By default, the environment will be publicly accessible at the address provided in the admin. If you have privacy considerations, you will need to create a tunnel between the environment and the repository.
Was this page helpful?