Updated Docker (markdown)

master
Hunter Long 2018-07-02 21:14:53 -07:00
parent 9697cb2b1a
commit 71221d7645
1 changed files with 150 additions and 1 deletions

151
Docker.md

@ -5,6 +5,71 @@ docker run -it -p 8080:8080 hunterlong/statup
``` ```
#### Or use Docker Compose #### Or use Docker Compose
This Docker Compose file inlcudes NGINX, Postgres, and Statup. This Docker Compose file inlcudes NGINX, Postgres, and Statup.
```yaml
version: '2.3'
services:
nginx:
container_name: nginx
image: jwilder/nginx-proxy
ports:
- 0.0.0.0:80:80
- 0.0.0.0:443:443
networks:
- internet
restart: always
volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro
- ./statup/nginx/certs:/etc/nginx/certs:ro
- ./statup/nginx/vhost:/etc/nginx/vhost.d
- ./statup/nginx/html:/usr/share/nginx/html:ro
- ./statup/nginx/dhparam:/etc/nginx/dhparam
environment:
DEFAULT_HOST: localhost
statup:
container_name: statup
image: hunterlong/statup:latest
restart: always
networks:
- internet
- database
depends_on:
- postgres
volumes:
- ./statup/app:/app
environment:
VIRTUAL_HOST: localhost
VIRTUAL_PORT: 8080
DB_CONN: postgres
DB_HOST: postgres
DB_USER: statup
DB_PASS: password123
DB_DATABASE: statup
NAME: EC2 Example
DESCRIPTION: This is a Statup Docker Compose instance
postgres:
container_name: postgres
image: postgres
restart: always
networks:
- database
volumes:
- ./statup/postgres:/var/lib/postgresql/data
environment:
POSTGRES_PASSWORD: password123
POSTGRES_USER: statup
POSTGRES_DB: statup
networks:
internet:
driver: bridge
database:
driver: bridge
```
Or a simple wget...
```bash ```bash
wget https://raw.githubusercontent.com/hunterlong/statup/master/servers/docker-compose.yml wget https://raw.githubusercontent.com/hunterlong/statup/master/servers/docker-compose.yml
docker-compose up -d docker-compose up -d
@ -12,10 +77,94 @@ docker-compose up -d
#### Docker Compose with Automatic SSL #### Docker Compose with Automatic SSL
You can automatically start a Statup server with automatic SSL encryption using this docker-compose file. First point your domain's DNS to the Statup server, and then run this docker-compose command with DOMAIN and EMAIL. Email is for letsencrypt services. You can automatically start a Statup server with automatic SSL encryption using this docker-compose file. First point your domain's DNS to the Statup server, and then run this docker-compose command with DOMAIN and EMAIL. Email is for letsencrypt services.
``` ```bash
wget https://raw.githubusercontent.com/hunterlong/statup/master/servers/docker-compose-ssl.yml wget https://raw.githubusercontent.com/hunterlong/statup/master/servers/docker-compose-ssl.yml
LETSENCRYPT_HOST=mydomain.com \ LETSENCRYPT_HOST=mydomain.com \
LETSENCRYPT_EMAIL=info@mydomain.com \ LETSENCRYPT_EMAIL=info@mydomain.com \
docker-compose -f docker-compose-ssl.yml up -d docker-compose -f docker-compose-ssl.yml up -d
``` ```
### Full docker-compose with Automatic SSL
```yaml
version: '2.3'
services:
nginx:
container_name: nginx
image: jwilder/nginx-proxy
ports:
- 0.0.0.0:80:80
- 0.0.0.0:443:443
labels:
- "com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy"
networks:
- internet
restart: always
volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro
- ./statup/nginx/certs:/etc/nginx/certs:ro
- ./statup/nginx/vhost:/etc/nginx/vhost.d
- ./statup/nginx/html:/usr/share/nginx/html:ro
- ./statup/nginx/dhparam:/etc/nginx/dhparam
environment:
DEFAULT_HOST: ${LETSENCRYPT_HOST}
letsencrypt:
container_name: letsencrypt
image: jrcs/letsencrypt-nginx-proxy-companion
networks:
- internet
restart: always
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- ./statup/nginx/certs:/etc/nginx/certs
- ./statup/nginx/vhost:/etc/nginx/vhost.d
- ./statup/nginx/html:/usr/share/nginx/html
- ./statup/nginx/dhparam:/etc/nginx/dhparam
statup:
container_name: statup
image: hunterlong/statup:latest
restart: always
networks:
- internet
- database
depends_on:
- postgres
volumes:
- ./statup/app:/app
environment:
VIRTUAL_HOST: ${LETSENCRYPT_HOST}
VIRTUAL_PORT: 8080
LETSENCRYPT_HOST: ${LETSENCRYPT_HOST}
LETSENCRYPT_EMAIL: ${LETSENCRYPT_EMAIL}
DB_CONN: postgres
DB_HOST: postgres
DB_USER: statup
DB_PASS: password123
DB_DATABASE: statup
NAME: SSL Example
DESCRIPTION: This Status Status Page should be running ${LETSENCRYPT_HOST} with SSL.
postgres:
container_name: postgres
image: postgres
restart: always
networks:
- database
volumes:
- ./statup/postgres:/var/lib/postgresql/data
environment:
POSTGRES_PASSWORD: password123
POSTGRES_USER: statup
POSTGRES_DB: statup
networks:
internet:
driver: bridge
database:
driver: bridge
```