cds-snc / hello-esdc

3 stars 0 forks source link
alpha cppd end-of-life esdc

hello-esdc

Project structure/files

Docker

There is a Dockerfile for the HelloESDC.API sub-project that will build a container for the API:

cd src/HelloESDC.API
docker build -t hello-esdc-api .

There are also empty Dockerfiles in the src/Web/WebSPA and src/Web/WebWxT folders for future use.

Running

There is a basic docker-compose.yml file at the root that will bring up the api and a postgres database. This is just taken from some example code (see References below), we don't have to stick with Postgres.

There currently is no interaction between the containers, just sample code at the moment.

You can bring up the containers by doing this:

  1. Navigate to project root in terminal
  2. Generate migration script: sh util/build_migrations.sh
  3. Launch Docker containers: docker-compose up --build

And the api will be available at: localhost:8000/api/values

To stop and reset:

  1. Exit the apps: CTRL+C
  2. Remove volumes: docker-compose down

Todo

There are quite a few pieces still missing, including:

References

Medium post example of .net core webapi project with postgresql database:

Indepth article about Microservices Architecture in .NET, plus a reference application