goat is a go api template 😉
It's a container with the api and a container with a postgresql database.
docker build -t goat .
docker run -p 8080:8080 goat
docker-compose up -d --build
show logs:
docker-compose logs -f goat
docker-compose logs -f postgres
in dev mode the air package is used for hot reload
docker-compose -f docker-compose.dev.yml up --build
# 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