Docker development for web and mobile back ends

Docker packages an application and its runtime into an image that runs the same way as a container on a laptop, in testing and in deployment. We containerise back ends and services, describe multi-service environments with Docker Compose, and build images that are small, run without unnecessary privileges and do not carry secrets.
Docker
  • Dockerfiles and multi-stage builds
  • Compose environments for local and test
  • Multi-platform images for Intel and ARM
  • Images without baked-in secrets

When Docker is the right choice

Docker suits teams that want one packaged runtime from development to deployment:

  • You want the same image to run on a developer machine, in test and CI, and in deployment.
  • You need a multi-service environment, such as an app, a database and a queue, described in one Compose file.
  • You deploy to a single server or a remote Docker host. Docker's Compose documentation calls a single server the easiest way to deploy.
  • You need images for more than one processor architecture, such as amd64 and arm64, from one build.

When Docker is not the right choice

Docker is not the answer to every deployment need:

  • You need to run across several servers. Compose targets one host, and its production guidance points to a Swarm cluster for scaling out; other orchestrators are a different tool.
  • Your data must outlive the container. Anything not saved to a volume or other persistent storage is lost when the container is removed.
  • You plan to use Docker Desktop in a larger organisation. Docker's terms require a paid subscription for professional use in larger organisations, so check the current terms. Docker Engine's terms are separate.
  • The workload is a small script that already runs fine on the host. A container adds a layer you then have to maintain.

What we build with Docker

Typical projects, described in general terms.

Containerising an application

A Dockerfile and image for an existing back end or service, with a documented way to build and run it.

Compose environments

App, database, queue and other services started together for local development and testing.

Build and release images

Images built in your pipeline and pushed to a registry, ready for the server or service that runs them.

Multi-platform images

One build that runs on both Intel and ARM machines, so developer laptops and servers use the same image.

Secure builds

Non-root users, secrets passed at build time without being stored in the image, and base images pinned to a version.

Data and volumes

Volumes for databases and uploads, and a plan for backups, so a replaced container does not lose data.

What Docker gives you

Docker's documentation defines an image as a read-only template with the instructions to create a container, and a container as a runnable instance of an image. A Dockerfile lists the commands that assemble the image. Multi-stage builds keep the final image small by leaving build tools behind. Registries, with Docker Hub as the public default, store and distribute images. Docker Compose describes an application of several containers, with their networks and volumes, in one YAML file. BuildKit and buildx can build one image for several platforms.

Volumes are storage managed by Docker that exists independently of any container, and Docker does not remove unused volumes automatically. Networks matter too: the default bridge network does not let containers find each other by name, while user-defined networks do.

What we get right when building images

  • Small, cache-friendly images: a minimal base, multi-stage builds, and update and install commands combined in one step so a stale cached layer cannot hide a change.
  • No unnecessary privileges: Docker's guidance is to switch to a non-root user when a service can run without privileges. We create the user explicitly.
  • No secrets in images: build arguments and environment variables persist in the final image, so we use build secret or SSH mounts instead.
  • Pinned base images: tags can change, so we pin to a digest and set up automated update pull requests for it.
  • A clean build context: a .dockerignore file keeps irrelevant files out of the build.
  • Production settings apart from development: a separate Compose override file for production changes such as removing code mounts and adding restart policies.

How we work

  1. Containerise one service first: prove the image builds and runs the same everywhere before adding more
  2. Write the environment down: Compose files and a short README so a new developer starts everything with one command
  3. Handle data and secrets deliberately: volumes for state, secret mounts for credentials, nothing sensitive in the image
  4. Hand over properly: the Dockerfiles and Compose files in your repository, and notes on how images are built, tagged and updated

Frequently asked questions

Is Docker Compose suitable for production?

Docker's production guidance describes deploying to a single server or a remote Docker host as the easiest route, with a separate override file for production changes such as removing code volume bindings and adding restart policies. For scaling it points to a Swarm cluster.

Will our data survive container restarts or replacement?

Only data kept in persistent storage such as a Docker volume. Volume contents are independent of any container and are not removed automatically, while anything else inside a removed container is lost.

Can the same image run on Intel and Apple Silicon or ARM servers?

Yes, if it is built as a multi-platform image. A single buildx build can target several platforms, and Docker pulls the variant that matches the machine.

Are secrets safe in Dockerfile ARG or ENV?

No. Docker's documentation says build arguments and environment variables persist in the final image. Build secret mounts and SSH mounts make secrets available during the build without storing them in the image.

Want your back end running in containers?

Tell us what runs today and where it needs to run. We will say what to containerise first and what to leave alone.

Related technologies

Technologies that appear alongside Docker in our case studies. Select one to see our work with it.

Three ways to work with us

Dedicated Hiring

Meet our team in an online meeting, interview the specialists and hire a dedicated team for your project.

Get a Quote

Fixed Scope

You share your requirements, we agree the scope and cost up front, and deliver against that scope.

Get a Quote

Time & Material

Best when the scope will change as you learn. You pay for the time and resources used, and you can adjust priorities as the work goes on.

Get a Quote

Tell us about your project