A toy project to learn about production coding.
-
Build docker image:
docker build -t simplebank:latest .
-
Create a network for running both the PostgreSQL container and the app binary they can discover each other:
docker network create bank-network
-
Run docker container:
docker run --name simplebank --network bank-network -p 8300:8300 -e GIN_MODE="release" -e DB_SOURCE="postgresql://postgres:password@db:5432/simple_bank?sslmode=disable" simplebank:latest
-
Generate SQL CRUD with sqlc:
make sqlc
-
Create a new DB migration:
migrate create -ext sql -dir db/migration -seq <migration_name>
-
Run server:
make server