Using Compose in Production
Using Compose in production
Compose is still primarily aimed at development and testing environments. Compose may be used for smaller production deployments, but is probably not yet suitable for larger deployments.
When deploying to production, you’ll almost certainly want to make changes to your app configuration that are more appropriate to a live environment. These changes may include:
- Removing any volume bindings for application code, so that code stays inside the container and can’t be changed from outside
- Binding to different ports on the host
- Setting environment variables differently (e.g., to decrease the verbosity of logging, or to enable email sending)
- Specifying a restart policy (e.g.,
restart: always
) to avoid downtime - Adding extra services (e.g., a log aggregator)
For this reason, you’ll probably want to define an additi