Install Docker and Docker Compose (Docker Compose comes with Docker on Windows and MacOS)
- Build the docker services with
docker-compose build
- Run the auth service database migrations with
docker-compose build auth && docker-compose run auth ./bin/goose up
- Start the services in detached mode with
docker-compose up -d
- Setup Kong services, routes and plugins with
sh ./bootstrap.sh
Kong Service will be live on http://localhost:8000
http://localhost:8000/auth/healthcheck
curl -X POST http://localhost:8000/auth/accounts/register -d '{ "data": { "email_address": "test@mail.com", "password": "password" }}'
curl -X POST http://localhost:8000/auth/accounts/login -d '{ "data": { "email_address": "test@mail.com", "password": "password" }}'
- Build Test Containers
docker-compose -f docker-compose.test.yaml build
- Build goose in test containers
docker-compose -f docker-compose.test.yaml run auth-test go build -o ./bin/goose ./cmd/goose/main.go
- Run Test DB Migrations Containers
docker-compose -f docker-compose.test.yaml run auth-test ./bin/goose up
- Run Tests
docker-compose -f docker-compose.test.yaml run auth-test go test
- Account Creation
[POST] http://localhost:8000/auth/accounts/register
- Authentication
[POST] http://localhost:8000/auth/accounts/login
- Health Check
[GET] http://localhost:8000/auth/healthcheck
Database migrations are handled by goose
Migrations Schemas are created in auth/db/migrations
To generate sql migrations schemas, the prefered migration type execute in the root folder.
docker-compose build auth && docker-compose run auth ./bin/goose create <migration_name> sql
To generate golang migrations schemas, execute in the root folder.
docker-compose build auth && docker-compose run auth ./bin/goose create <migration_name> go
docker-compose build auth && docker-compose run auth ./bin/goose up
To view executed and pending migrations run
docker-compose build auth && docker-compose run auth ./bin/goose status