Playground in golang-based web frameworks
Preparation
-
Install Task
-
Install pre-commit
-
Install pre-commit hooks, pull docker images and build containers:
task init
-
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