mirror of https://github.com/statping/statping
parent
47805d086d
commit
f1300629d4
|
@ -2,13 +2,13 @@ FROM golang:1.10.3-alpine
|
|||
|
||||
RUN apk update && apk add git g++ libstdc++ ca-certificates
|
||||
|
||||
WORKDIR $GOPATH/src/github.com/hunterlong/statup/
|
||||
WORKDIR $GOPATH/src/github.com/hunterlong/statup
|
||||
|
||||
COPY . .
|
||||
RUN go get github.com/GeertJohan/go.rice/rice
|
||||
RUN cd cmd && go get -d -v
|
||||
RUN cd source && rice embed-go
|
||||
RUN cd cmd && go install
|
||||
RUN cd cmd && go install && mv $GOPATH/bin/cmd /usr/local/bin/statup
|
||||
|
||||
RUN wget -q https://assets.statup.io/sass && \
|
||||
chmod +x sass && \
|
||||
|
@ -24,4 +24,4 @@ RUN printf "#!/usr/bin/env sh\n\$1\n" > $CMD_FILE && \
|
|||
WORKDIR /app
|
||||
VOLUME /app
|
||||
EXPOSE 8080
|
||||
CMD ["/go/bin/statup"]
|
||||
ENTRYPOINT statup
|
6
Makefile
6
Makefile
|
@ -1,4 +1,4 @@
|
|||
VERSION=0.37
|
||||
VERSION=0.38
|
||||
GOPATH:=$(GOPATH)
|
||||
GOCMD=`which go`
|
||||
GOBUILD=$(GOCMD) build
|
||||
|
@ -11,6 +11,7 @@ BUILDVERSION=-ldflags="-X main.VERSION=$(VERSION)"
|
|||
BINARY_NAME=statup
|
||||
RICE=$(GOPATH)/bin/rice
|
||||
DOCKER=`which docker`
|
||||
DOCKER_COMP=`which docker-compose`
|
||||
PATH:=/usr/local/bin:$(GOPATH)/bin:$(PATH)
|
||||
|
||||
all: deps compile install clean
|
||||
|
@ -63,6 +64,9 @@ docker-run: docker
|
|||
docker-dev-run: docker-dev
|
||||
$(DOCKER) run -t -p 8080:8080 hunterlong/statup:dev
|
||||
|
||||
docker-test: docker-dev
|
||||
$(DOCKER_COMP) -f servers/docker-compose-test.yml up
|
||||
|
||||
databases:
|
||||
$(DOCKER) run --name statup_postgres -p 5432:5432 -e POSTGRES_PASSWORD=password123 -e POSTGRES_USER=root -e POSTGRES_DB=root -d postgres
|
||||
$(DOCKER) run --name statup_mysql -p 3306:3306 -e MYSQL_ROOT_PASSWORD=password123 -e MYSQL_DATABASE=root -d mysql
|
||||
|
|
|
@ -0,0 +1,51 @@
|
|||
version: '2.3'
|
||||
|
||||
services:
|
||||
|
||||
statup:
|
||||
container_name: statup
|
||||
image: hunterlong/statup:dev
|
||||
networks:
|
||||
- internet
|
||||
- database
|
||||
depends_on:
|
||||
- postgres_statup
|
||||
- postgres_mysql
|
||||
entrypoint:
|
||||
- "sleep 30 && cd /go/src/github.com/hunterlong/statup && go test -v ./..."
|
||||
environment:
|
||||
GO_ENV: test
|
||||
DB_CONN: postgres
|
||||
DB_HOST: postgres_statup
|
||||
DB_USER: root
|
||||
DB_PASS: root
|
||||
DB_DATABASE: statup
|
||||
NAME: EC2 Example
|
||||
DESCRIPTION: This is a Statup Docker Compose instance
|
||||
|
||||
postgres_statup:
|
||||
container_name: postgres_statup
|
||||
image: postgres
|
||||
restart: always
|
||||
networks:
|
||||
- database
|
||||
environment:
|
||||
POSTGRES_PASSWORD: password123
|
||||
POSTGRES_USER: statup
|
||||
POSTGRES_DB: statup
|
||||
|
||||
postgres_mysql:
|
||||
container_name: mysql_statup
|
||||
image: mysql
|
||||
restart: always
|
||||
networks:
|
||||
- database
|
||||
environment:
|
||||
MYSQL_ROOT_PASSWORD: password123
|
||||
MYSQL_DATABASE: statup
|
||||
|
||||
networks:
|
||||
internet:
|
||||
driver: bridge
|
||||
database:
|
||||
driver: bridge
|
|
@ -0,0 +1,44 @@
|
|||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
{{if USE_CDN}}
|
||||
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" integrity="sha384-WskhaSGFgHYWDcbwN70/dfYBj47jz9qbsMId/iRN3ewGhXQFZCSftd1LZCfmhktB" crossorigin="anonymous">
|
||||
<link rel="stylesheet" href="https://assets.statup.io/base.css">
|
||||
{{ else }}
|
||||
<link rel="stylesheet" href="/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="/css/base.css">
|
||||
{{end}}
|
||||
<title>Statup | Logs</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="container col-md-7 col-sm-12 mt-md-5 bg-light">
|
||||
|
||||
{{if Auth}}
|
||||
{{template "nav"}}
|
||||
{{end}}
|
||||
|
||||
<div class="col-12">
|
||||
|
||||
<textarea id="live_logs" class="form-control" rows="40" readonly></textarea>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
{{template "footer"}}
|
||||
|
||||
{{if USE_CDN}}
|
||||
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
|
||||
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js" integrity="sha384-smHYKdLADwkXOn1EmN1qk/HfnUcbVRZyYmZ4qpPea6sjB/pTJ0euyQp0Mk8ck+5T" crossorigin="anonymous"></script>
|
||||
<script src="https://assets.statup.io/main.js"></script>
|
||||
{{ else }}
|
||||
<script src="/js/jquery-3.3.1.slim.min.js"></script>
|
||||
<script src="/js/bootstrap.min.js"></script>
|
||||
<script src="/js/main.js"></script>
|
||||
{{end}}
|
||||
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue