Connect to MySQL on Golang and Create Docker-Compose file

  Рет қаралды 1,534

david hwang

david hwang

Күн бұрын

Now that we have a Dockerfile for our Go app from our last video, we want to run the Go app along with a MySQL container.
In this video, we will extend our Go app to insert & get users into/from the database before writing our docker-compose yaml. We will validate everything works at the end of the video.
github: github.com/dhi...

Пікірлер: 8
@dhij
@dhij 8 ай бұрын
0:00 Introduction 0:22 Start: extend the Go app to integrate MySQL 0:33 Change ID to UUID 0:42 Create a DB with sql.Open() 1:13 Defining host in the db source: running mysql as stand-alone container vs. in a docker-compose 2:54 Import mysql driver 3:14 Extend ServeHTTP to accept POST requests 3:33 Add the createUser() and getUser() handlers 5:26 Go microservices project folder structure 6:35 Modify existing Dockerfile 7:25 Write docker-compose.yaml 8:24 expose vs. ports field 12:34 Create a `users_db` database and a `users` table in the mysql container 14:13 Validate the app by sending GET and POST on localhost:8080/users using curl
@TerenceSilonda
@TerenceSilonda 5 ай бұрын
I had an issue with the app connecting to the DB. One minute into your video my problem is solved.
@sinamobasheri
@sinamobasheri 6 ай бұрын
I have question what's best practice and natural way to automate last part, the database stuff, automating database initialization stuff like creating roles, tables etc. and even fill it with previous data (if any) thanks in advance 💟
@IkraamDev
@IkraamDev 8 ай бұрын
The text is very small. It’s hard to see.
@dhij
@dhij 8 ай бұрын
oops :)
@adi.wahyudi
@adi.wahyudi 7 ай бұрын
❤❤❤
@DJMerrell86
@DJMerrell86 Ай бұрын
Your voice audio only plays in my left ear
@dhij
@dhij Ай бұрын
my apology, thats my bad 😓
ЗАПУСКАЕМ Golang ПРИЛОЖЕНИЕ В ДОКЕРЕ
16:32
The Art of Development
Рет қаралды 10 М.
Part 5. Roblox trend☠️
00:13
Kan Andrey
Рет қаралды 2,9 МЛН
REAL 3D brush can draw grass Life Hack #shorts #lifehacks
00:42
MrMaximus
Рет қаралды 8 МЛН
Стойкость Фёдора поразила всех!
00:58
МИНУС БАЛЛ
Рет қаралды 7 МЛН
Deploy Go App to Production Kubernetes & Database
34:14
david hwang
Рет қаралды 856
Airflow for Beginners: Build Amazon books ETL Job in 10 mins
13:13
Sunjana in Data
Рет қаралды 11 М.
sqlc - Generate your Go database code with ease
11:18
Go Web Examples
Рет қаралды 15 М.
Using Docker Compose with Mysql And Node
8:24
Daniel Amber
Рет қаралды 18 М.
Use Docker for Your Golang Projects with Live Reloading
6:34
Microservices with Databases can be challenging...
20:52
Software Developer Diaries
Рет қаралды 63 М.
Full Stack App: Next.js 14, Go, Postgres, Docker
1:23:29
Francesco Ciulla
Рет қаралды 13 М.