Todolist

This repository provides a base project to implemet Todolist application.

docker-compose.yml provides Go 1.17 build tool, MySQL server and phpMyAdmin.

Dependencies

How to run the application

First, you need to start Docker containers.

$ docker-compose up -d

This command will take time to download and build the containers.

Now you can start the application with the following command.

$ docker-compose exec app go run main.go

You can also execute go run main.go directly if you have Go development tools on your machine, but you need to setup the configuration to connect the application with MySQL server.

When you finish exercise, please don't forget to stop the containers.

$ docker-compose down

Advanced: How to initialize database

When you modify the database schema, you will need to discard the current DB volumes for creating a new one. It will be easier to rebuild everything than to rebuild only DB container. Following command helps you to do it.

$ docker-compose down --rmi all --volumes --remove-orphans
$ docker-compose up -d