<LEARN/>
← /paths/cloud

<project · intermediate>

Containerised app

Package an app with Docker and run it with a database using Compose.

Build containerised app one manageable milestone at a time. Keep your decisions, tests and finished work together so your portfolio shows what you learned, not only the final result.

Build it step by step

  1. Prepare a small app

    Use a simple local API with a PostgreSQL database. Add a health endpoint and read connection settings from environment variables.

  2. Write the Dockerfile

    Choose a supported minimal base image, install locked dependencies and run as a non-root user. Add a .dockerignore excluding secrets and dependencies.

  3. Connect services

    Create compose.yaml with separate app and database services. Use service names for database connections and a named volume for persistent data.

  4. Handle readiness

    Add database and application health checks. Make startup retry transient connection failures and document how migrations run before serving requests.

  5. Prove persistence

    Run docker compose up, create a record, stop and recreate containers, then read the record back. Confirm database ports are not exposed unnecessarily.

  6. Share your finished work

    Commit your source and a README explaining setup, decisions, tests and limitations. Remove secrets and personal data, credit dependencies and assets, then add the public repository or portfolio link and an optional working demo to LEARN Showcase. Hosting is optional; a clear repository or design case study is enough.

// done when

  • A fresh checkout starts with Compose
  • App does not run as root
  • Data survives container recreation
  • Health checks reflect service readiness
  • README includes setup, credits and limitations; shared links are safe and accessible

// stretch goals

  • Add a development override
  • Test restoring a database backup

Finished? Show it off

Add your project to the LEARN showcase so other learners and employers can see it.

Sign in to add your finished project to the showcase.