Ready to Deploy#

The container from the last milestone contains an integrated database, which is handy for testing but not sufficient for production. In production your container should use an external database. That gives the designer of the infrastructure the flexibility to choose the database solution that’s the right size and cost. In this milestone you must implement the ability for your container to connect to an external database.

Requirements#

  1. Move the integrated SQLite database into a volume (to do this it needs to be in its own directory).

  2. Add the ability to control which database to use:

    1. On first run the DB_ENGINE environment variable should be set to either sqlite or postgres to make the selection.

  3. If the postgres DMBS is selected it should be configured with the following environment variables:

    1. DB_NAME - The name of the database to use.

    2. DB_USER - The user account that accesses the database

    3. DB_PASSWORD - The user’s password

    4. DB_HOST - The hostname of the database server

Turn In#

Turn in answers to the questions in the lab:

  1. Where is the source code of our mysite application?

  2. What are the dependencies of our application?

  3. What is the configuration of our application?

  4. What is the runtime data in our application?

I will pull and run your container.