This is a proof of concept MVP (minimum viable product) of how a golang-gatsby containerized app would run and with being managed by Docker Compose.
├── docker-compose.yml
├── gatsby
│ ├── Dockerfile
│ ├── src
│ ├── ...
└── golang
├── Dockerfile
├── Makefile
├── src
└── ...
Each folder contains an src being the main folder and a Dockerfile for building the container for that certain app.
Each Dockerfile will then be called by the docker-compose.yml to spin up and be orchestrated.
The Makefile can be called on development to automate the process of compiling and generating Go compiled binaries.
This app is a microservice oriented app that's consisted of 2 microservices (for the sake of simplicity of an MVP):
- Gatsby (Frontend)
- Golang (Backend)
The microservices are on their own containers and each has its own Dockerfile. The containers are then managed and orchestrated by Docker-Compose.
There are several concepts that I've shown with this application, those are:
- Sending and Receiving HTTP Requests through the internal network of Docker-Compose.
- Constructing a consumable REST API with Golang and serving it through a port with Docker.
- Consuming an API of a port from a different container through Docker-Container's internal network with Gatsby.
- Automating building and serving a Golang web app with a Makefile.
Git clone
docker-compose up -d