Skip to content

Instantly share code, notes, and snippets.

View TrinhTrungDung's full-sized avatar
🏠
Working from home

Trịnh Trung Dũng TrinhTrungDung

🏠
Working from home
  • Buuuk
  • Ho Chi Minh City, Vietnam
View GitHub Profile
@TrinhTrungDung
TrinhTrungDung / main.go
Created March 20, 2020 11:59
Connect to the database created by docker container
package main
import (
"fmt"
"github.com/jinzhu/gorm"
_ "github.com/jinzhu/gorm/dialects/postgres"
)
func main() {
@TrinhTrungDung
TrinhTrungDung / docker-compose.yml
Last active March 22, 2020 02:43
Create new container which has PostgreSQL database
version: "3"
services:
db:
image: postgres
container_name: test.db
ports:
- "5432:5432"
environment:
POSTGRES_DB: testdb
POSTGRES_USER: testuser