Skip to content

rjw57/components-db-golang

Repository files navigation

Playground in golang-based web frameworks

Preparation

  1. Install Task

  2. Install pre-commit

  3. Install pre-commit hooks, pull docker images and build containers:

    task init
  4. Start the application:

    task up

The first time you commit you may need to run:

$ GOFLAGS=-buildvcs=false pre-commit

Starting and stopping the application

If starting from scratch:

$ docker compose up --wait

Stream logs:

$ docker compose logs -f backend

Run with latest images and dependencies:

$ docker compose build --pull
$ docker compose up --wait

Open a database shell:

$ docker compose run psql

Run production backend:

$ docker compose --profile production up --build prod-backend

Stopping:

$ docker compose --profile=* down

Stopping and removing local state:

$ docker compose --profile=* down --volumes --remove-orphans

Testing

Running backend tests

$ docker compose run backend-test

Updating database migrations

$ docker compose run atlas-make-migrations

Backend container

Configuration environment variables:

  • DATABASE_DSN - (required) postgres connection string
  • HOST - bind interface. Default: 0.0.0.0
  • POST - bind port. Default: 8000

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published