todolist-goland
A simple CRUD todo list application that is powered by Docker and Go. Docker compose will run two containers todolist and mysql. Please keep in mind that the app will depend on the success of the database container as it waits for it to start (see ./sysops/entrypoint.sh). All of these configurations are found on the docker-compose.yml file.
Getting Started
In order to get this application up and running, please install the following technologies:
Docker
Docker Compose
brew install docker-compose
Go
brew install golang
MySQL
Docker will bootstrap mysql (version 8.0.23
) for usage. The database will be called todolist
, but feel free to change the actual name if desired. Please keep in mind, if changes are applied, to reflect those changes inside the docker-compose.yml file.
Golang
If you are new to Go, please configure your Go workspace
( bin, pkg, & src) first. Here is a link to help you get started: local go. Once you have those set up, clone this repository inside of your src
folder.
Environmental Variables
In order to successfully run this application, you need to configure your .env
file first (as docker will use some of its variables). There is a template of this already here. Copy this template in your real .env
file and fill in the password of your choosing. You can opt in to the default mysql password root.
Running the application
Once you have properly configured everything, execute the following command on the root level of this app via terminal:
Build the containers (app & database)
docker compose build
Run the app
docker compose up
It's alive!
Application is hosted on localhost:8080.
Trouble shooting
If you are coming across errors, please make sure to remove your docker volumes and re-build everything! (I know it is tedious).