This repo contains the accompanying demo app for the How To Dockerize Golang Webapp With Postgres DB tutorial at fabioberger.com.
Run these commands from psql
to set up the app's postgres user and db:
CREATE USER app;
CREATE DATABASE testapp;
GRANT ALL PRIVILEGES ON DATABASE testapp TO app;
Install:
go get github.com/fabioberger/dockerize-tutorial
Start Server:
go run main.go
Setup a Postgres Docker Container as described in the tutorial. Then run these two commands:
docker pull fabioberger/dockerize-tutorial
docker run -d -p 8080:4000 --name tutapp --link dbtest:postgres fabioberger/dockerize-tutorial