Skip to content

rniksch/modernization-unicorn-store

Repository files navigation

modernization-unicorn-store

Buy some Magical Unicorns and deploy the Unicorn Store to a Docker container running .NET Core on Alpine Linux.

Prerequisites

To get started you will need:

Getting Started

Once you have the prerequisites installed on your local development machine you should be able to run the Unicorn Store locally either in your IDE or in a local container. Take the time to read mutiple environments in ASP.NET Core and safe storage of app secrets in development in ASP.NET Core before starting so you understand the various different configuration options.

The Unicorn Store is meant to run in a Docker container and demonstrates how you can run the UnicornDB in Amazon RDS while storing the RDS credentials to the database in AWS Secrets Manager. This allows the Unicorn Store application to safely connect to the database from the container without storing the secrets in a file on the container.

Testing locally with your IDE

If you want to test locally you have the option to set a couple of flags in the various different appsettings files such as: appsettings.Development.json

  • CacheDbResults - Cache in-memory in ASP.NET Core

  • UseInMemoryStore - Set to true to use the in-memory database on Mac and Linux systems.

  • UseLocalDB - Set to true to use LocalDB on Windows systems.

  • UseLocalSecrets - Use the Secret Manager tool in local development to set the secret to connect to your UnicornDB database. Ensure that the local secret you create for the connection to the UnicornDB mirrors the secret value format when you retrieve a RDS secret from Secrets Manager. The structure should follow the below example:

    {
    "unicornstore-secret": {
        "username": "unicorndbuser",
        "password": "unicrondbpassword",
        "engine": "sqlserver",
        "host": "unicorn-db-us-west-2.rds.amazonaws.com",
        "port": 1433,
        "dbInstanceIdentifier": "unicorn-store-test"
    }
    }
  • RunInFargate - Set to true when running the container in AWS Fargate.

1. Build the container using Docker Compose
docker-compose build
2. Bring the container online on your local machine.

docker-compose -f docker-compose.yml -f docker-compose.development.yml up

3. Test that the container is up and running.

http://localhost

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published