Created Docker Compose (markdown)

master
Hunter Long 2020-02-21 14:32:05 -08:00
parent 6f3ef1d1fe
commit fbd3699f4a
1 changed files with 177 additions and 0 deletions

177
Docker-Compose.md Normal file

@ -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
```