Dev vs Staging vs Production
To configure the differences between development, staging and production environments, there are several techniques which may be used separately or combined in certain use cases:
- For image building:
- Using different Dockerfiles for each environment
- Using the same Dockerfile and:
- overriding the
ENTRYPOINT
or theCMD
of the Dockerfile for each environment - using multi-stage builds and setting the
target
during the build process - using different
buildArgs
for different environments
- overriding the
- For deployments:
- Using a different
cmd
and/orargs
for your containers depending on the environment - Using a different
image
name orimage
tag for your containers depending on the environment - Setting different
env
variables for your containers depending on the environment
- Using a different
No matter which options are working for your use case, the following DevSpace features will allow you to set up the desired differences: