From fbd3699f4abf6bcda7ce3ed9239a082713617660 Mon Sep 17 00:00:00 2001 From: Hunter Long Date: Fri, 21 Feb 2020 14:32:05 -0800 Subject: [PATCH] Created Docker Compose (markdown) --- Docker-Compose.md | 177 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 177 insertions(+) create mode 100644 Docker-Compose.md diff --git a/Docker-Compose.md b/Docker-Compose.md new file mode 100644 index 0000000..2b0002d --- /dev/null +++ b/Docker-Compose.md @@ -0,0 +1,177 @@ +This page includes multiple docker-compose.yml setups for you to run. There are many environment variables for additional settings and features, checkout the Environment Variables Wiki to see them all. + +### Database Configurations + - [SQLite](https://github.com/hunterlong/statping/wiki/_new#basic-setup) + - MySQL + - Postgres +### Metrics + - Grafana with Prometheus +### Web Serving + - Nginx as proxy pass + - Nginx with LetEncrypt SSL Cert + +--- + +# Docker Volumes +- Main Volume: `/app` +- Config file: `/app/config.yml` +- Logs: `/app/logs` +- Assets: `/app/assets` (if you use custom styling) +- SQLite database: `/app/statping.db` + +--- + +# Basic SQLite Connection +This docker-compose will start Statping on port 8080 and automatically run on a SQLite database. +```yaml +statping: + container_name: statping + image: hunterlong/statping + restart: always + ports: + - 8080:8080 + volumes: + - ./statping:/app + environment: + DB_CONN: sqlite +``` + +# MySQL Connection +```yaml +statping: + container_name: statping + image: hunterlong/statping + restart: always + ports: + - 8080:8080 + volumes: + - statping_data:/app + links: + - mysql + environment: + DB_CONN: mysql + DB_HOST: mysql + DB_PORT: 3306 + DB_DATABASE: statping + DB_USER: root + DB_PASS: password123 + +mysql: + image: mysql:5.7 + volumes: + - mysql_data:/var/lib/mysql + restart: always + ports: + - 3306:3306 + environment: + MYSQL_ROOT_PASSWORD: password123 + MYSQL_DATABASE: statping + MYSQL_USER: root + MYSQL_PASSWORD: password +``` + +# Postgres +```yaml +statping: + container_name: statping + image: hunterlong/statping + restart: always + ports: + - 8080:8080 + volumes: + - statping_data:/app + links: + - postgres + environment: + DB_CONN: postgres + DB_HOST: postgres + DB_PORT: 5432 + DB_DATABASE: statping + DB_USER: root + DB_PASS: password123 + +postgres: + container_name: postgres + image: postgres:10.0-alpine + ports: + - 5432:5432 + volumes: + - pg_data:/var/lib/postgresql/data/pg_data + environment: + POSTGRES_PASSWORD: password123 + POSTGRES_DB: statping + POSTGRES_USER: root + POSTGRES_PORT: 5432 + PGDATA: /var/lib/postgresql/data/pg_data +``` + +# Nginx Proxy Pass + +```yaml +statping: + container_name: statping + image: hunterlong/statping + restart: always + volumes: + - statping_data:/app + environment: + DB_CONN: sqlite + VIRTUAL_HOST: demo.statping.com + VIRTUAL_PORT: 8080 + +nginx: + container_name: nginx + image: jwilder/nginx-proxy + ports: + - 80:80 + volumes: + - /var/run/docker.sock:/tmp/docker.sock:ro +``` + +# Nginx Proxy Pass with SSL (LetEncrypt) + +```yaml +statping: + container_name: statping + image: hunterlong/statping + restart: always + volumes: + - statping_data:/app + environment: + DB_CONN: sqlite + LETSENCRYPT_HOST: demo.statping.com + VIRTUAL_HOST: demo.statping.com + VIRTUAL_PORT: 8080 + +nginx: + container_name: nginx + image: jwilder/nginx-proxy + restart: always + ports: + - 80:80 + - 443:443 + volumes: + - /var/run/docker.sock:/tmp/docker.sock:ro + - cert_volume:/etc/nginx/certs + - vhost_volume:/etc/nginx/vhost.d + - html_volume:/usr/share/nginx/html + environment: + DEFAULT_HOST: demo.statping.com + labels: + - "com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy" + +nginx-ssl: + container_name: nginx-ssl + image: jrcs/letsencrypt-nginx-proxy-companion + restart: always + links: + - nginx + volumes: + - /var/run/docker.sock:/var/run/docker.sock:ro + - cert_volume:/etc/nginx/certs + - vhost_volume:/etc/nginx/vhost.d + - html_volume:/usr/share/nginx/html + environment: + DEFAULT_EMAIL: info@mydomain.com + NGINX_PROXY_CONTAINER: nginx +``` \ No newline at end of file