π₯οΈ How to build a Dockerized RESTful API application using Go.
Cloud Native Application Development is a one way of speeding up building web applications, using micro-services, containers and orchestration tools.
As the first step, this repository shows How to build a Dockerized RESTful API application using Go.
π‘ Refer learning-cloud-native-go.github.io or commit messages and
step-branches for a step by step guild.
π Hope to use Wire for Compile-time Dependency Injection in the future.
π‘ Building Docker image for production
docker build -f docker/app/prod.Dockerfile . -t myapp_app
dockerfolder. But keep the
docker-compose.ymlfile in the project root.
cmdfolder.
migrationsfolder.
appfolder.
. βββ docker β βββ app β βββ bin β β βββ init.sh β β βββ wait-for-mysql.sh β βββ Dockerfile βββ docker-compose.yml β βββ cmd β βββ app β β βββ main.go β βββ migrate β βββ main.go β βββ migrations β βββ 20190805170000_create_books_table.sql β βββ app β βββ app β β βββ app.go β β βββ book_handler.go β β βββ health_handler.go β β βββ index_handler.go β βββ requestlog β β βββ handler.go β β βββ log_entry.go β βββ router β βββ middleware β β βββ content_type_json.go β β βββ content_type_json_test.go β βββ router.go β βββ config β βββ config.go β βββ adapter β βββ db β β βββ db.go β βββ gorm β βββ gorm.go β βββ util β βββ logger β β βββ logger.go β β βββ logger_test.go β βββ validator β βββ validator.go β βββ validator_test.go β βββ model β βββ book.go βββ repository β βββ book.go β βββ go.mod βββ go.sum
π‘ About
app/app/app.go; Some preferapp/server/server.goorhttp/app/app.go