docker-compose
$ docker compose -p go-tempalte up -d
build docker image
$ docker build -t go-restapi:latest .
start container
$ docker run --rm -p 8080:8080 -e DATABASE_URL="postgres://postgres:postgres@pg:5432/develop?sslmode=disable" --net=go-tempalte_default --name go-restapi go-restapi:latest
ENV
PORT=8080
DATABASE_URL="postgres://postgres:postgres@pg:5432/develop?sslmode=disable"
https://github.com/jackc/tern
up
DATABASE_URI=postgres://postgres:postgres@localhost:5432/develop?sslmode=disable tern migrate -m migrate
down
DATABASE_URI=postgres://postgres:postgres@localhost:5432/develop?sslmode=disable tern migrate --destination -1 -m migrate
create
DATABASE_URI=postgres://postgres:postgres@localhost:5432/develop?sslmode=disable tern new user-and-add -m migrate