mirror of https://github.com/statping/statping
upgrades
parent
99e9efd824
commit
0660debfc6
|
@ -18,13 +18,13 @@ func CheckServices() {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *Service) CheckQueue() {
|
func (s *Service) CheckQueue() {
|
||||||
|
defer s.CheckQueue()
|
||||||
s.Check()
|
s.Check()
|
||||||
if s.Interval < 1 {
|
if s.Interval < 1 {
|
||||||
s.Interval = 1
|
s.Interval = 1
|
||||||
}
|
}
|
||||||
fmt.Printf(" Service: %v | Online: %v | Latency: %v\n", s.Name, s.Online, s.Latency)
|
fmt.Printf(" Service: %v | Online: %v | Latency: %v\n", s.Name, s.Online, s.Latency)
|
||||||
time.Sleep(time.Duration(s.Interval) * time.Second)
|
time.Sleep(time.Duration(s.Interval) * time.Second)
|
||||||
s.CheckQueue()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *Service) Check() *Service {
|
func (s *Service) Check() *Service {
|
||||||
|
|
|
@ -0,0 +1,60 @@
|
||||||
|
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
|
||||||
|
- /home/ubuntu/nginx/certs:/etc/nginx/certs:ro
|
||||||
|
- /home/ubuntu/nginx/vhost:/etc/nginx/vhost.d
|
||||||
|
- /home/ubuntu/nginx/html:/usr/share/nginx/html:ro
|
||||||
|
- /home/ubuntu/nginx/dhparam:/etc/nginx/dhparam
|
||||||
|
|
||||||
|
statup:
|
||||||
|
container_name: statup
|
||||||
|
image: hunterlong/statup
|
||||||
|
networks:
|
||||||
|
- internet
|
||||||
|
- database
|
||||||
|
depends_on:
|
||||||
|
- nginx
|
||||||
|
- postgres
|
||||||
|
volumes:
|
||||||
|
- /home/ubuntu/statup:/app
|
||||||
|
environment:
|
||||||
|
VIRTUAL_HOST: statup.cjx.io
|
||||||
|
VIRTUAL_PORT: 8080
|
||||||
|
DOMAIN: statup.cjx.io
|
||||||
|
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:
|
||||||
|
- /home/ubuntu/postgres:/var/lib/postgresql/data
|
||||||
|
environment:
|
||||||
|
POSTGRES_PASSWORD: password123
|
||||||
|
POSTGRES_USER: statup
|
||||||
|
POSTGRES_DB: statup
|
||||||
|
|
||||||
|
networks:
|
||||||
|
internet:
|
||||||
|
driver: bridge
|
||||||
|
database:
|
||||||
|
driver: bridge
|
Loading…
Reference in New Issue