Offer a better docker example (#75)
This commit is contained in:
parent
d4b24ed573
commit
595f2fd82c
25
Dockerfile
25
Dockerfile
|
@ -1,22 +1,11 @@
|
||||||
FROM golang AS builder
|
FROM golang:1.13
|
||||||
# RUN apk add --no-cache git gcc
|
|
||||||
|
LABEL maintainer="llitfkitfk@gmail.com,chenjiandongx@qq.com"
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
|
RUN apt-get update && apt-get install net-tools -y
|
||||||
|
|
||||||
COPY . .
|
COPY . .
|
||||||
RUN ./control build docker
|
RUN ./control build docker
|
||||||
|
RUN mv /app/bin/* /usr/local/bin
|
||||||
FROM buildpack-deps:buster-curl
|
|
||||||
LABEL maintainer="llitfkitfk@gmail.com"
|
|
||||||
|
|
||||||
WORKDIR /app
|
|
||||||
|
|
||||||
COPY --from=builder /app/docker/scripts /app/scripts
|
|
||||||
COPY --from=builder /app/etc /app/etc
|
|
||||||
# Change default address (hard code)
|
|
||||||
RUN ./scripts/sed.sh
|
|
||||||
|
|
||||||
COPY --from=builder /app/bin /usr/local/bin
|
|
||||||
|
|
||||||
|
|
||||||
# ENTRYPOINT []
|
|
||||||
# CMD []
|
|
||||||
|
|
15
README.md
15
README.md
|
@ -19,13 +19,22 @@ cd nightingale
|
||||||
./control build
|
./control build
|
||||||
```
|
```
|
||||||
|
|
||||||
## Quick Start (need install docker for [mac](https://docs.docker.com/docker-for-mac/install/)/[win](https://docs.docker.com/docker-for-windows/install/))
|
## Quickstart with Docker
|
||||||
|
|
||||||
|
We has offered a Docker demo for the users who want to give it a try. Before you get started, make sure you have installed **Docker** & **docker-compose** and there are some details you should know.
|
||||||
|
|
||||||
|
* We highly recommend users prepare a new VM environment to use it.
|
||||||
|
* All the core components will be installed on your OS according to the `docker-compose.yaml`.
|
||||||
|
* Nightingale will use the following ports, `80`, `5800`, `5810`, `5811`, `5820`, `5821`, `5830`, `5831`, `5840`, `5841`, `6379`, `2058`, `3306`.
|
||||||
|
|
||||||
|
Okay. Run it! Once the docker finish its jobs, visits http://your-env-ip in your broswer. Default username and password is `root:root`.
|
||||||
```bash
|
```bash
|
||||||
docker-compose up -d
|
$ docker-compose up -d
|
||||||
# open http://localhost in web browser
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
![dashboard](https://user-images.githubusercontent.com/19553554/78956965-8b9c6180-7b16-11ea-9747-6ed5e62b068d.png)
|
||||||
|
|
||||||
|
|
||||||
## Team
|
## Team
|
||||||
|
|
||||||
[ulricqin](https://github.com/ulricqin) [710leo](https://github.com/710leo) [jsers](https://github.com/jsers) [hujter](https://github.com/hujter) [n4mine](https://github.com/n4mine) [heli567](https://github.com/heli567)
|
[ulricqin](https://github.com/ulricqin) [710leo](https://github.com/710leo) [jsers](https://github.com/jsers) [hujter](https://github.com/hujter) [n4mine](https://github.com/n4mine) [heli567](https://github.com/heli567)
|
||||||
|
|
|
@ -1,28 +1,34 @@
|
||||||
version: "3"
|
version: "3"
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
mysql-data:
|
mysql-data:
|
||||||
|
|
||||||
services:
|
services:
|
||||||
nginx:
|
nginx:
|
||||||
image: nginx:stable-alpine
|
image: nginx:stable-alpine
|
||||||
|
network_mode: host
|
||||||
ports:
|
ports:
|
||||||
- 80:80
|
- 80:80
|
||||||
volumes:
|
volumes:
|
||||||
- ./docker/nginx/nginx.conf:/etc/nginx/nginx.conf
|
- ./docker/nginx/nginx.conf:/etc/nginx/nginx.conf
|
||||||
- ./docker/nginx/conf.d:/etc/nginx/conf.d
|
- ./docker/nginx/conf.d:/etc/nginx/conf.d
|
||||||
- ./pub:/home/n9e/pub
|
- ./pub:/home/n9e/pub
|
||||||
api:
|
|
||||||
|
nightingale:
|
||||||
build: .
|
build: .
|
||||||
image: api
|
image: nightingale
|
||||||
|
|
||||||
monapi:
|
monapi:
|
||||||
image: api
|
image: nightingale
|
||||||
|
network_mode: host
|
||||||
restart: always
|
restart: always
|
||||||
command: n9e-monapi
|
command: n9e-monapi
|
||||||
ports:
|
ports:
|
||||||
- 5800:5800
|
- 5800:5800
|
||||||
|
|
||||||
transfer:
|
transfer:
|
||||||
image: api
|
image: nightingale
|
||||||
|
network_mode: host
|
||||||
restart: always
|
restart: always
|
||||||
command: n9e-transfer
|
command: n9e-transfer
|
||||||
ports:
|
ports:
|
||||||
|
@ -30,7 +36,8 @@ services:
|
||||||
- 5811:5811
|
- 5811:5811
|
||||||
|
|
||||||
tsdb:
|
tsdb:
|
||||||
image: api
|
image: nightingale
|
||||||
|
network_mode: host
|
||||||
restart: always
|
restart: always
|
||||||
command: n9e-tsdb
|
command: n9e-tsdb
|
||||||
ports:
|
ports:
|
||||||
|
@ -38,7 +45,8 @@ services:
|
||||||
- 5821:5821
|
- 5821:5821
|
||||||
|
|
||||||
index:
|
index:
|
||||||
image: api
|
image: nightingale
|
||||||
|
network_mode: host
|
||||||
restart: always
|
restart: always
|
||||||
command: n9e-index
|
command: n9e-index
|
||||||
ports:
|
ports:
|
||||||
|
@ -46,7 +54,8 @@ services:
|
||||||
- 5831:5831
|
- 5831:5831
|
||||||
|
|
||||||
judge:
|
judge:
|
||||||
image: api
|
image: nightingale
|
||||||
|
network_mode: host
|
||||||
restart: always
|
restart: always
|
||||||
command: n9e-judge
|
command: n9e-judge
|
||||||
ports:
|
ports:
|
||||||
|
@ -54,28 +63,23 @@ services:
|
||||||
- 5841:5841
|
- 5841:5841
|
||||||
|
|
||||||
collector:
|
collector:
|
||||||
image: api
|
image: nightingale
|
||||||
|
network_mode: host
|
||||||
restart: always
|
restart: always
|
||||||
command: n9e-collector
|
command: n9e-collector
|
||||||
ports:
|
ports:
|
||||||
- 2058:2058
|
- 2058:2058
|
||||||
|
|
||||||
# web:
|
|
||||||
# build:
|
|
||||||
# context: web
|
|
||||||
# restart: always
|
|
||||||
# command: npm run dev
|
|
||||||
# ports:
|
|
||||||
# - 8010:8010
|
|
||||||
|
|
||||||
redis:
|
redis:
|
||||||
image: redis
|
image: redis
|
||||||
|
network_mode: host
|
||||||
restart: always
|
restart: always
|
||||||
ports:
|
ports:
|
||||||
- 6379:6379
|
- 6379:6379
|
||||||
|
|
||||||
mysql:
|
mysql:
|
||||||
image: mysql:5.7
|
image: mysql:5.7
|
||||||
|
network_mode: host
|
||||||
restart: always
|
restart: always
|
||||||
environment:
|
environment:
|
||||||
- MYSQL_ROOT_PASSWORD=1234
|
- MYSQL_ROOT_PASSWORD=1234
|
||||||
|
@ -84,5 +88,3 @@ services:
|
||||||
volumes:
|
volumes:
|
||||||
- ./sql:/docker-entrypoint-initdb.d
|
- ./sql:/docker-entrypoint-initdb.d
|
||||||
- mysql-data:/var/lib/mysql
|
- mysql-data:/var/lib/mysql
|
||||||
|
|
||||||
|
|
|
@ -47,17 +47,17 @@ http {
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
|
||||||
upstream n9e.monapi {
|
upstream n9e.monapi {
|
||||||
server monapi:5800;
|
server localhost:5800;
|
||||||
keepalive 10;
|
keepalive 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
upstream n9e.index {
|
upstream n9e.index {
|
||||||
server index:5830;
|
server localhost:5830;
|
||||||
keepalive 10;
|
keepalive 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
upstream n9e.transfer {
|
upstream n9e.transfer {
|
||||||
server transfer:5810;
|
server localhost:5810;
|
||||||
keepalive 10;
|
keepalive 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,8 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
set -xe
|
|
||||||
|
|
||||||
sed -i 's/127.0.0.1:6379/redis:6379/g' /app/etc/judge.yml
|
|
||||||
sed -i 's/127.0.0.1:6379/redis:6379/g' /app/etc/monapi.yml
|
|
||||||
sed -i 's/127.0.0.1:3306/mysql:3306/g' /app/etc/mysql.yml
|
|
||||||
sed -i 's/127.0.0.1:5821/tsdb:5821/g' /app/etc/transfer.yml
|
|
Loading…
Reference in New Issue