go web api server environment template.
- golang:1.15.12
- Air
- gin
- gorm
- goose
- mysql:5.7
- phpmyadmin
-
copy env
$cd app/
$cp .env.example .env
$cd ..
-
change db name on .env and docker-compose.yml
-
build docker image
$docker-compose build
-
make container of web(go), mysql, phpmyadmin
$docker-compose up -d
-
check server logs
$make logs
-
enter the web container
$make web
-
migration
#goose up
-
access web
http://localhost:8080/
access phpmyadmin
http://localhost:8081/
- You don't need to run
go run main.go
everytime you changed go file. Air is running in go_web container