-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #84 from redjax/dev
Dev
- Loading branch information
Showing
25 changed files
with
2,563 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Containers | ||
|
||
The root `docker-compose.yml` file builds the MkDocs site in a containerized environment, then serves it with NGINX in the `serve` layer. | ||
|
||
The containers in this directory are for local development only. | ||
|
||
**Make sure to copy [`.env.example`](./.env.example) -> `.env`, then edit the environment file to set your ports and container image versions.** | ||
|
||
## Dockerfiles | ||
|
||
### Dockerfile | ||
|
||
This is the "main" Dockerfile, which uses a multi-stage build to create the MkDocs site and serve with either `mkdocs serve` (in the `run` layer), or builds the site and copies it to an NGINX reverse proxy to serve the static HTML. | ||
|
||
### vscode.Dockerfile | ||
|
||
A customized `openvscode-server` image. Installs the SSH and Git packages, as well as a number of VSCode extensions helpful to the development of this site. Serves a VSCode interface in the browser for quickly editing the docs here. | ||
|
||
This image is useful is hosting this site on a remote machine where editing over SSH is impossible or difficult. | ||
|
||
## Compose stacks | ||
|
||
### dev.docker-compose.yml | ||
|
||
A local development stack. Serves the MkDocs site from within a Docker container using `mkdocs serve`. The site mounts the project in the container so any changes made to the files will live-reload the MkDocs site. | ||
|
||
### web-edit.docker-compose.yml | ||
|
||
Includes the MkDocs site, an `openvscode-server` VSCode server, and an NGINX container with a self-signed SSL certificate. **NOTE**: You must generate your SSL certificates/keys using the [`generate_ssl_certificates.sh`](./generate_ssl_certificates.sh) script.** |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Import/Export VSCode Extensions | ||
|
||
You can export a list of your VSCode extensions to a text file, then loop that text file to install the extensions. This is how plugins like VSCode's "settings sync" work, but you can do it manually. | ||
|
||
This is also useful for Docker containers like `openvscode-server`, where you can add a list of VSXi extensions to install from [[open-vsx.org](https://open-vsx.org)]. | ||
|
||
## Export VSCode extensions | ||
|
||
### Linux | ||
|
||
```bash title="Export VSCode extensions to text file" linenums="1" | ||
code --list-extensions > vscode-extensions.list | ||
``` | ||
|
||
### Windows | ||
|
||
```powershell title="Export VSCode extensions to text file" linenums="1" | ||
code --list-extensions > vscode-extensions.list | ||
``` | ||
|
||
## Import VSCode extensions | ||
|
||
### Linux | ||
|
||
```bash title="Import VSCode extensions from text file" linenums="1" | ||
cat vscode-extensions.list | xargs -L 1 code --install-extension | ||
``` | ||
|
||
### Windows | ||
|
||
```powershell title="Import VSCode extensions from text file" linenums="1" | ||
cat vscode-extensions.list |% { code --install-extension $_ } | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,135 @@ | ||
# Prometheus | ||
|
||
Prometheus is equal parts database, logging server, and monitoring/alerting. It's a very useful tool for many use cases, for example as a backend for Grafana. | ||
|
||
## Directory Structure | ||
|
||
```text title="Container directory structure" | ||
container_root/ | ||
../.env | ||
../.gitignore | ||
../docker-compose.yml | ||
../data/prometheus | ||
../alert.rules | ||
../prometheus.yml | ||
``` | ||
|
||
## Container Files | ||
|
||
### .env | ||
|
||
```text title="prometheus .env" linenums="1" | ||
## Default: 9090 | ||
PROMETHEUS_WEBUI_PORT= | ||
## Default: ./data/prometheus/prometheus.yml | ||
PROMETHEUS_CONFIG_FILE= | ||
## Default: ./data/prometheus/alert.rules | ||
PROMETHEUS_ALERTMANAGER_RULES_FILE= | ||
``` | ||
|
||
### .gitignore | ||
|
||
```text title="prometheus .gitignore" linenums="1" | ||
data/* | ||
data/prometheus/* | ||
!data/prometheus/ | ||
!data/prometheus/example.* | ||
!data/prometheus/example.*.* | ||
!example.* | ||
!example.*.* | ||
!*.example | ||
!*.example.* | ||
!.*.example | ||
!.*.example.* | ||
``` | ||
|
||
### docker-compose.yml | ||
|
||
```text title="prometheus docker-compose.yml" linenums="1" | ||
--- | ||
services: | ||
prometheus: | ||
image: prom/prometheus:latest | ||
container_name: minio-prometheus | ||
volumes: | ||
- ${PROMETHEUS_CONFIG_FILE:-./data/prometheus/prometheus.yml}:/etc/prometheus/prometheus.yml | ||
- ${PROMETHEUS_ALERTMANAGER_RULES_FILE:-./data/prometheus/alert.rules}:/alertmanager/alert.rules | ||
command: | ||
- "--config.file=/etc/prometheus/prometheus.yml" | ||
ports: | ||
- ${PROMETHEUS_WEBUI_PORT:-9090}:9090 | ||
``` | ||
|
||
### data/prometheus/alert.rules | ||
|
||
```text title="alert.rules" linenums="1" | ||
groups: | ||
- name: example | ||
rules: | ||
## Alert for any instance unreachable for >5 mins | ||
- alert: InstanceDown | ||
expr: up == 0 | ||
for: 5m | ||
``` | ||
|
||
### data/prometheus/prometheus.yml | ||
|
||
```yaml title="prometheus.yml" linenums="1" | ||
global: | ||
scrape_interval: 15s | ||
|
||
rule_files: | ||
- "/alertmanager/alert.rules" | ||
|
||
scrape_configs: | ||
- job_name: "minio-cluster" | ||
## This can be omitted if MinIO has env variable: | ||
# MINIO_PROMETHEUS_AUTH_TYPE="public" | ||
# bearer_token: TOKEN | ||
metrics_path: /minio/v2/metrics/cluster | ||
scheme: https | ||
static_configs: | ||
- targets: ["minio:9001"] | ||
|
||
- job_name: "minio-nodes" | ||
## This can be omitted if MinIO has env variable: | ||
# MINIO_PROMETHEUS_AUTH_TYPE="public" | ||
# bearer_token: TOKEN | ||
metrics_path: /minio/v2/metrics/node | ||
scheme: https | ||
static_configs: | ||
- targets: ["minio:9001"] | ||
|
||
- job_name: "minio-bucket" | ||
## This can be omitted if MinIO has env variable: | ||
# MINIO_PROMETHEUS_AUTH_TYPE="public" | ||
# bearer_token: TOKEN | ||
metrics_path: /minio/v2/metrics/bucket | ||
scheme: https | ||
static_configs: | ||
- targets: ["minio:9001"] | ||
|
||
- job_name: "minio-resource" | ||
## This can be omitted if MinIO has env variable: | ||
# MINIO_PROMETHEUS_AUTH_TYPE="public" | ||
# bearer_token: TOKEN | ||
metrics_path: /minio/v2/metrics/resource | ||
scheme: https | ||
static_configs: | ||
- targets: ["minio:9001"] | ||
|
||
``` | ||
|
||
## Notes | ||
|
||
- The `data/prometheus/` directory (and the files within, `alert.rules` and `prometheus.yml`) do not exist by default, you must create them before starting the container. | ||
|
||
## Links |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Documents | ||
|
||
Containers related to the creation, management, and sending of documents. |
Oops, something went wrong.