Skip to content

Latest commit

 

History

History
43 lines (32 loc) · 901 Bytes

README.md

File metadata and controls

43 lines (32 loc) · 901 Bytes

Go template

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"

Migrate

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