42 lines
949 B
Markdown
42 lines
949 B
Markdown
# Deployment
|
|
|
|
1. Create the Influx token offline:
|
|
|
|
```bash
|
|
echo "apiv3_$(openssl rand -base64 64 | tr -d '+/=')" > secrets/admin-token.txt
|
|
```
|
|
|
|
2. Copy `.env.template` to `.env` and change/add value if necessary:
|
|
|
|
```bash
|
|
cp .env.template .env
|
|
```
|
|
|
|
3. Deploy the stack:
|
|
|
|
```bash
|
|
docker compose up -d
|
|
```
|
|
|
|
## Development
|
|
|
|
### Swagger Documentation
|
|
To ensure the Swagger documentation is always up to date, we use [pre-commit](https://pre-commit.com/). It runs `swag init` automatically before each commit if any Go files in `db/src` have changed.
|
|
|
|
To install the hooks:
|
|
```bash
|
|
pre-commit install
|
|
```
|
|
|
|
Alternatively, you can run it manually:
|
|
```bash
|
|
pre-commit run --all-files
|
|
```
|
|
or from `db/src`:
|
|
```bash
|
|
swag init
|
|
```
|
|
|
|
## Traefik
|
|
A traefik config file is available on [traefik.yml](./traefik.yml). It can be used with an OIDC provider ([Authentik](https://github.com/goauthentik/authentik) in our case) to control access to the database explorer.
|