TGIMBA TypeScript API Tuneup – Step 6 – Local Dynamo Db in Docker Container using Docker-Compose

Git  Code

I have been contemplating my last blog statement about using the containers in the cloud and I think that may have been a little misplaced.  If you are in the cloud, use a real SQL Server and Dynamo Db instance.  Soooo, this entry will be simply to move the Dynamo Db Dockerfile created in the last blog entry to be used with a command called docker-compose.   For the future, I will use the local Dynamo Db and SQL Server instances for local development tests.

Docker-compose is a command I have become aware of.  As described in reference #2, it is a tool for dealing with multiple docker containers.  Its ‘contents’ are contained in a file called ‘docker-compose.yml’  Since I have 2 (I will move the SQL Server container into the docker-compose.yml in the next blog post), it seems like a good tool to use 🙂

To create the TGIMBA API docker-compose.yml:

  • I deleted the aws dynamo db files downloaded earlier.

Screen Shot 2018-01-07 at 9.31.21 PM

  • I moved the contents of the Dockerfile into one called ‘tgimba.dynamo.Docker’.

Screen Shot 2018-01-07 at 9.33.23 PM

  • Added a docker-compose.yml file to the root of the TGIMBA API project which I modeled after reference #1,

Screen Shot 2018-01-07 at 9.42.35 PM

  • run this command in terminal – docker-compose up -d

NOTE: When I went to run it all again, I got some container conflicts.  To overcome, I ran the three docker statements I put in the last blog post to completely clear out my docker setup.  I was not expecting this.

Screen Shot 2018-01-07 at 9.50.55 PM

  • I modified the local dynamo db url to point to 8000.

Screen Shot 2018-01-07 at 9.52.20 PM

  • Started the SQL Server container (see reference #4) and ran the integration tests

Screen Shot 2018-01-07 at 10.05.38 PM

I will attempt to place the SQL Server instance into the docker-compose.yml file as well for next time.

Stay tuned!





Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s