Tanukistack is a template for the development of web application. This contains the following components:
gonewcommand
$ go install golang.org/x/tools/cmd/gonew@latest- aqua
- PostgreSQL
$ gonew github.com/mackee/template-tanukistack path/to/your/module ./your_directory
$ cd path/to/your/project
$ aqua i.env file is required to run the application. Create a .env file in the root directory of the project and write the following contents.
$ echo 'DATABASE_DSN="postgres://user:password@localhost:5432/dbname?sslmode=disable"' > .env$ task dev$ task testA devcontainer setup is provided so you can develop without installing Go, task, or PostgreSQL on the host.
- Docker
- devcontainer CLI
$ brew install --cask devcontainer # or: npm install -g @devcontainers/cli
$ task dc:up # build & start the container (first run takes a while)
$ task dc:exec -- task test # run tests against the postgres sidecar
$ task dc:exec -- task dev # run the dev server (forwarded to host :8080)
$ task dc:shell # open a shell inside the container
$ task dc:down # stop & remove containers (volumes are kept)DATABASE_DSNis set incontainerEnvto point at the bundled postgres sidecar, so a host.envis not required.- aqua-managed tools (
go,task) are installed onpostCreateand cached in a named volume. - The postgres data volume (
pgdata) is preserved acrossdc:down/dc:up.
MIT