One image can run as several containers
A Docker image contains an application, its runtime, the libraries it needs and its start command. It serves as a template: several containers can start from the same image, for example in development and production.
A container is an isolated instance with its own processes and filesystem. It uses the kernel of its runtime environment. The image fixes the software being shipped; environment variables, network access and mounted storage also affect how the application behaves.
Uploads need storage beyond the container
A newly uploaded invoice does not become part of the image. The application writes it to mounted storage that exists independently of the container. Database files need the same separation. Secrets such as passwords are supplied at runtime and should also stay out of the image.
Files in a container’s writable layer survive a restart of that container. They are lost when it is deleted and a new container is created from the image. A volume or mounted directory keeps data through that replacement; you still need backups.
What starts during local development
For a MainPath backend, mp run-local starts the database and other services as containers, along with the development server. You need a Docker environment such as Docker Desktop. This does not mean the local development server runs in the same container that the pipeline will publish. Requirements for local development lists the tools you need.
How MainPath deploys a new version
For deployment to a classic server, the pipeline builds an image and pushes it to the registry. The deployment configuration records the intended version tag, and Ansible deploys that version to the server.
Backend data lives outside the containers on that server: database files under ./backend-mysql and uploads under ./backend-uploads. The uploads directory is mounted at /app/upload inside the container. A release replaces the containers and continues to use these directories. Architecture explains this process and the other deployment options.