Skip to content
/ goat Public

go api template [read only mirror of git.bitcubix.io/goat/goat]

Notifications You must be signed in to change notification settings

goat-tool/goat

Repository files navigation

goat

goat is a go api template 😉

It's a container with the api and a container with a postgresql database.

run with docker

docker build -t goat .
docker run -p 8080:8080 goat

run with compose

docker-compose up -d --build

show logs:

docker-compose logs -f goat
docker-compose logs -f postgres

run compose in dev mode

in dev mode the air package is used for hot reload

docker-compose -f docker-compose.dev.yml up --build

migrate db

# in config.yaml change database.host to localhost

# in docker-compose.yml add port mapping to postgres
# ports:
    #   - 5432:5432

# Build and start Database
docker-compose up --build -d postgres

# Run migrate cli command
go run goat migrate