moved docker-compose into dev

pull/109/head
Hunter Long 2018-12-04 03:11:36 -08:00
parent 97c3c08603
commit f7cc9a3699
12 changed files with 21 additions and 188 deletions

1
.gitignore vendored
View File

@ -10,6 +10,7 @@ plugins/*.so
data
build
vendor
dev/plugin/*.so
html/scss/.sass-cache
dart-sass
.sass-cache

View File

@ -1,6 +0,0 @@
FROM alpine:latest
MAINTAINER "Hunter Long (https://github.com/hunterlong)"
RUN apk --no-cache add libstdc++ ca-certificates
WORKDIR /app
ADD sass /usr/local/bin/
ADD ./build/alpine-linux-amd64 /usr/local/bin/statping

View File

@ -7,9 +7,11 @@ services:
image: hunterlong/statping:latest
restart: always
ports:
- 0.0.0.0:80:8080
- 80:8080
volumes:
- ./statping/app:/app
- ./statping:/app
expose:
- 8080
environment:
NAME: Single Docker Image
NAME: Statping
DESCRIPTION: You'll need to input your own Database information in Setup process

View File

@ -56,8 +56,8 @@ services:
DB_USER: statping
DB_PASS: password123
DB_DATABASE: statping
NAME: SSL Example
DESCRIPTION: This Status Status Page should be running ${LETSENCRYPT_HOST} with SSL.
NAME: Statping SSL Instance
DESCRIPTION: This Statping Status Page should be running ${LETSENCRYPT_HOST} with SSL.
postgres:
container_name: postgres
@ -72,6 +72,13 @@ services:
POSTGRES_USER: statping
POSTGRES_DB: statping
watchtower:
image: v2tec/watchtower
restart: always
volumes:
- /var/run/docker.sock:/var/run/docker.sock
command: --interval 120 --cleanup
networks:
internet:
driver: bridge

View File

@ -12,7 +12,7 @@
cd /home/ubuntu
source /home/ubuntu/.profile
sudo rm -rf startup.sh > /dev/null
sudo curl -o startup.sh -H 'Cache-Control: no-cache' https://raw.githubusercontent.com/hunterlong/statping/master/servers/startup.sh > /dev/null
sudo curl -o startup.sh -H 'Cache-Control: no-cache' https://raw.githubusercontent.com/hunterlong/statping/master/dev/startup.sh > /dev/null
sudo chmod +x startup.sh > /dev/null
sudo rm -f docker-compose.yml > /dev/null
@ -21,7 +21,7 @@ EC_IP=$(curl -s http://169.254.169.254/latest/meta-data/public-ipv4)
if [ "$LETSENCRYPT_HOST" = "" ]
then
sudo curl -o docker-compose.yml -H 'Cache-Control: no-cache' https://raw.githubusercontent.com/hunterlong/statping/master/servers/docker-compose.yml > /dev/null
sudo curl -o docker-compose.yml -H 'Cache-Control: no-cache' https://raw.githubusercontent.com/hunterlong/statping/master/dev/docker-compose-single.yml > /dev/null
else
printf " \n\n\n\nDomain found for SSL certificate - $LETSENCRYPT_HOST\n"
printf "================================================================================================================\n"
@ -33,7 +33,7 @@ else
printf " A $LETSENCRYPT_HOST => $EC_IP (or use A record if you are using an Elastic IP)\n"
printf "================================================================================================================\n\n\n"
sudo curl -o docker-compose.yml -H 'Cache-Control: no-cache' https://raw.githubusercontent.com/hunterlong/statping/master/servers/docker-compose-ssl.yml > /dev/null
sudo curl -o docker-compose.yml -H 'Cache-Control: no-cache' https://raw.githubusercontent.com/hunterlong/statping/dev/docker-compose-ssl.yml > /dev/null
fi
sudo service docker start > /dev/null
@ -49,10 +49,10 @@ fi
sudo docker system prune -af > /dev/null
sudo curl https://raw.githubusercontent.com/hunterlong/statping/master/servers/init.sh > /home/ubuntu/init.sh
sudo curl https://raw.githubusercontent.com/hunterlong/statping/dev/init.sh > /home/ubuntu/init.sh
sudo chmod +x /home/ubuntu/init.sh > /dev/null
printf "\n\n\n\n\n Status Status Page on EC2\n"
printf "\n\n\n\n\n Statping Status Page on EC2\n"
printf "================================================================================================================\n"
if [ "$LETSENCRYPT_HOST" = "" ]
then

View File

@ -23,4 +23,4 @@ printf "Downloading latest version URL: $FILE\n"
curl -L -sS $FILE -o statping.tar.gz && tar xzf statping.tar.gz && rm statping.tar.gz
chmod +x statping
mv statping /usr/local/bin/
echo "Statup $VERSION has been successfully installed! Try 'statping version' to check it!"
echo "Statping $VERSION has been successfully installed! Try 'statping version' to check it!"

View File

@ -1,120 +0,0 @@
# Statping Server Setup
There are multiple way to startup a Statping server. You want to make sure Statping is on it's own instance that is not on the same server as the applications you wish to monitor.
It doesn't look good when your Status Page goes down, I recommend a small EC2 instance so you can set it, and forget it.
> It's a good idea to have a Status Page not on the same server as your applications.
# Install on Linux
Installing on Linux is a pretty easy task. Simply run the command below to have the `statping` command ready to rock.
```bash
bash <(curl -s https://statping.com/install.sh)
statping version
```
# Install on Mac
Installing on Mac/OSX is also very easy,
```bash
bash <(curl -s https://statping.com/install.sh)
statping version
```
# Install on Windows
Go to the [Latest Releases](https://github.com/hunterlong/statping/releases/latest) page for Statping and simply download `statping-windows-x64`!
Statping only supports Windows 64-bit currently, sorry 32-bit users. Rename the file to `statping` for ease of use!
# Install on Docker
This Docker image uses Alpine Linux to keep it ultra small.
```bash
docker run -it -p 8080:8080 hunterlong/statping
```
#### Or use Docker Compose
This Docker Compose file inlcudes NGINX, Postgres, and Statping.
```bash
wget https://raw.githubusercontent.com/hunterlong/statping/master/servers/docker-compose.yml
docker-compose up -d
```
#### Docker Compose with Automatic SSL
You can automatically start a Statping server with automatic SSL encryption using this docker-compose file. First point your domain's DNS to the Statping server, and then run this docker-compose command with DOMAIN and EMAIL. Email is for letsencrypt services.
```
wget https://raw.githubusercontent.com/hunterlong/statping/master/servers/docker-compose-ssl.yml
LETSENCRYPT_HOST=mydomain.com \
LETSENCRYPT_EMAIL=info@mydomain.com \
docker-compose -f docker-compose-ssl.yml up -d
```
# Install on EC2
Running Statping on the smallest EC2 server is very quick using the AWS AMI Image: `ami-7be8a103`.
### Create Security Groups
```bash
aws ec2 create-security-group --group-name StatpingPublicHTTP --description "Statping HTTP Server on port 80 and 443"
# will response back a Group ID. Copy ID and use it for --group-id below.
aws ec2 authorize-security-group-ingress --group-id sg-7e8b830f --protocol tcp --port 80 --cidr 0.0.0.0/0
aws ec2 authorize-security-group-ingress --group-id sg-7e8b830f --protocol tcp --port 443 --cidr 0.0.0.0/0
```
### Create EC2 without SSL
```bash
aws ec2 run-instances \
--image-id ami-7be8a103 \
--count 1 --instance-type t2.nano \
--key-name MYKEYHERE \
--security-group-ids sg-7e8b830f
```
### Create EC2 with Automatic SSL Certification
```bash
wget https://raw.githubusercontent.com/hunterlong/statping/master/servers/ec2-ssl.sh
```
Edit ec2-ssl.sh and insert your domain you want to use, then run command below. Use the Security Group ID that you used above for --security-group-ids
```
aws ec2 run-instances \
--user-data file://ec2-ssl.sh \
--image-id ami-7be8a103 \
--count 1 --instance-type t2.nano \
--key-name MYKEYHERE \
--security-group-ids sg-7e8b830f
```
#### EC2 Server Specs
- t2.nano ($4.60 monthly)
- 8gb SSD Memory
- 0.5gb RAM
- Docker with Docker Compose installed
- Running Statping, NGINX, and Postgres
- boot scripts to automatically clean unused containers.
## AWS EC2 (`ami-1f7c3567`)
Running Statping on the smallest EC2 server is very quick using the AWS AMI Image: `ami-1f7c3567`.
```
aws ec2 run-instances \
--image-id ami-1f7c3567 \
--count 1 \
--instance type t2.micro \
--region us-west-2
--key-name <key name> \
--security-group-ids <your security group id here> \
--subnet-id <your subnet id here> \
--region <your region here>
```
## Docker Compose
In this folder there is a standard docker-compose file that include nginx, postgres, and Statping.
```$xslt
docker-compose up -d
```
## Docker Compose with Automatic SSL
You can automatically start a Statping server with automatic SSL encryption using this docker-compose file. First point your domain's DNS to the Statping server, and then run this docker-compose command with DOMAIN and EMAIL. Email is for letsencrypt services.
```
DOMAIN=mydomain.com EMAIL=info@mydomain.com \
docker-compose -f docker-compose-ssl.yml up -d
```
## Systemd
```$xslt
/etc/systemd/system/statping.service
```

View File

@ -1,51 +0,0 @@
version: '2.3'
services:
statping:
container_name: statping
image: hunterlong/statping:dev
networks:
- internet
- database
depends_on:
- postgres_statping
- postgres_mysql
entrypoint:
- "sleep 30 && cd /go/src/github.com/hunterlong/statping && go test -v ./..."
environment:
GO_ENV: test
DB_CONN: postgres
DB_HOST: postgres_statping
DB_USER: root
DB_PASS: root
DB_DATABASE: statping
NAME: EC2 Example
DESCRIPTION: This is a Statping Docker Compose instance
postgres_statping:
container_name: postgres_statping
image: postgres
restart: always
networks:
- database
environment:
POSTGRES_PASSWORD: password123
POSTGRES_USER: statping
POSTGRES_DB: statping
postgres_mysql:
container_name: mysql_statping
image: mysql
restart: always
networks:
- database
environment:
MYSQL_ROOT_PASSWORD: password123
MYSQL_DATABASE: statping
networks:
internet:
driver: bridge
database:
driver: bridge