Cloud and applications
Docker containers
With Docker, you can test a new version of your website while the live site continues to serve visitors. Each container runs one part of the application with the dependencies it needs. You can update the website, database or background worker separately.
The same image for testing and production
An image packages your application code, libraries and runtime. Docker uses that image to start a container. For example, you can test a new PHP version on a copy of your website. Once you’ve checked that it works, you can deploy the same image to production with the live domain and credentials.
Connecting services with Docker Compose
In an online store, the website serves visitors, the database records orders and a background worker sends confirmations. Docker Compose lets you describe these services, their networks and their volumes in one file. You can make the website public and keep the database on an internal network that only the services that need it can reach.
Where do files and data go?
When you replace a container, any changes stored only inside it are lost. A volume lets you keep your catalog photos, for example, and attach them to the new container. To recover orders after an incident, take consistent database backups and check that you can restore them.
Updating and monitoring your application
Before you release a version, use a test environment to check that sign-in, forms and scheduled tasks still work. After deployment, logs and CPU and memory metrics help you spot problems. If the update changes the database schema, plan how to recover the data in case you need to roll back.