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
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 .
docker run -p 8000:8000 --name env_container env_image