Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions deploy/mongodb/init.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash
set -e
echo 'Initializing a fresh instance'
mongo <<EOF
use admin
db.adminCommand({setParameter: 1, internalQueryExecMaxBlockingSortBytes: 52428800})
use hawkeye
db.createUser({
user: '$ROOT_USERNAME',
pwd: '$ROOT_PASSWORD',
roles: [{
role: 'readWrite',
db: 'hawkeye'
}]
})
EOF
4 changes: 4 additions & 0 deletions deploy/nginx/Hawkeye.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ server {
listen 80;
charset utf-8;
location / {
auth_basic "Auth";
auth_basic_user_file /Hawkeye/server/passwd ;
gzip on;
gzip_min_length 1k;
gzip_buffers 16 64k;
Expand All @@ -14,6 +16,8 @@ server {
index index.html index.htm index.php;
}
location /api {
auth_basic "Auth";
auth_basic_user_file /Hawkeye/server/passwd ;
gzip_min_length 1k;
gzip_buffers 16 64k;
gzip_http_version 1.1;
Expand Down
3 changes: 2 additions & 1 deletion deploy/supervisor/hawkeye.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ directory=/Hawkeye/server
startsecs=5
stopwaitsecs=0
autostart=true
autorestart=true
autorestart=true
priority=800
3 changes: 2 additions & 1 deletion deploy/supervisor/huey.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ directory=/Hawkeye/server
startsecs=5
stopwaitsecs=0
autostart=true
autorestart=true
autorestart=true
priority=800
3 changes: 2 additions & 1 deletion deploy/supervisor/openresty.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ directory=/tmp
startsecs=5
stopwaitsecs=0
autostart=true
autorestart=true
autorestart=true
priority=999
3 changes: 2 additions & 1 deletion deploy/supervisor/redis.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ directory=/tmp
startsecs=10
stopwaitsecs=0
autostart=true
autorestart=true
autorestart=true
priority=800
8 changes: 8 additions & 0 deletions deploy/supervisor/startup.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[program:startup]
command=bash -c 'echo "${WEB_USERNAME}:`openssl passwd ${WEB_PASSWORD}`" > /Hawkeye/server/passwd'
directory=/tmp
startsecs=0
stopwaitsecs=0
autostart=true
autorestart=false
priority=100
35 changes: 35 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
version: '3'

services:
mongodb:
image: mongo
restart: always
expose:
- "27017"
environment:
ROOT_USERNAME: hawkeye
ROOT_PASSWORD: hawkeye
MONGO_INITDB_DATABASE: hawkeye
volumes:
- mongodb-data:/data/db
- "./deploy/mongodb/init.sh:/docker-entrypoint-initdb.d/hawkeye.sh"

hawkeye:
image: daocloud.io/0xbug/hawkeye
build: .
depends_on:
- mongodb
ports:
- 8001:80
environment:
WEB_USERNAME: admin
WEB_PASSWORD: hawkeye
MONGODB_URI: mongodb://hawkeye:hawkeye@mongodb:27017/hawkeye
MONGODB_USER: hawkeye
MONGODB_PASSWORD: hawkeye
links:
- mongodb

volumes:
mongodb-data:
driver: local