commit
0fd6176ac6
@ -0,0 +1 @@
|
||||
web
|
@ -0,0 +1,28 @@
|
||||
FROM golang AS builder
|
||||
# RUN apk add --no-cache git gcc
|
||||
WORKDIR /app
|
||||
|
||||
# comment this if using vendor
|
||||
# ENV GOPROXY=https://mod.gokit.info
|
||||
# COPY go.mod go.sum ./
|
||||
# RUN go mod download
|
||||
|
||||
COPY . .
|
||||
ENV GOPROXY=https://mod.gokit.info
|
||||
RUN ./control build docker
|
||||
|
||||
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 []
|
@ -0,0 +1,88 @@
|
||||
version: "3"
|
||||
volumes:
|
||||
mysql-data:
|
||||
services:
|
||||
nginx:
|
||||
image: nginx:stable-alpine
|
||||
ports:
|
||||
- 80:80
|
||||
volumes:
|
||||
- ./docker/nginx/nginx.conf:/etc/nginx/nginx.conf
|
||||
- ./docker/nginx/conf.d:/etc/nginx/conf.d
|
||||
- ./pub:/home/n9e/pub
|
||||
api:
|
||||
build: .
|
||||
image: api
|
||||
|
||||
monapi:
|
||||
image: api
|
||||
restart: always
|
||||
command: n9e-monapi
|
||||
ports:
|
||||
- 5800:5800
|
||||
|
||||
transfer:
|
||||
image: api
|
||||
restart: always
|
||||
command: n9e-transfer
|
||||
ports:
|
||||
- 5810:5810
|
||||
- 5811:5811
|
||||
|
||||
tsdb:
|
||||
image: api
|
||||
restart: always
|
||||
command: n9e-tsdb
|
||||
ports:
|
||||
- 5820:5820
|
||||
- 5821:5821
|
||||
|
||||
index:
|
||||
image: api
|
||||
restart: always
|
||||
command: n9e-index
|
||||
ports:
|
||||
- 5830:5830
|
||||
- 5831:5831
|
||||
|
||||
judge:
|
||||
image: api
|
||||
restart: always
|
||||
command: n9e-judge
|
||||
ports:
|
||||
- 5840:5840
|
||||
- 5841:5841
|
||||
|
||||
collector:
|
||||
image: api
|
||||
restart: always
|
||||
command: n9e-collector
|
||||
ports:
|
||||
- 2058:2058
|
||||
|
||||
# web:
|
||||
# build:
|
||||
# context: web
|
||||
# restart: always
|
||||
# command: npm run dev
|
||||
# ports:
|
||||
# - 8010:8010
|
||||
|
||||
redis:
|
||||
image: redis
|
||||
restart: always
|
||||
ports:
|
||||
- 6379:6379
|
||||
|
||||
mysql:
|
||||
image: mysql:5.7
|
||||
restart: always
|
||||
environment:
|
||||
- MYSQL_ROOT_PASSWORD=1234
|
||||
ports:
|
||||
- 3306:3306
|
||||
volumes:
|
||||
- ./sql:/docker-entrypoint-initdb.d
|
||||
- mysql-data:/var/lib/mysql
|
||||
|
||||
|
@ -0,0 +1,89 @@
|
||||
user root;
|
||||
|
||||
worker_processes auto;
|
||||
worker_cpu_affinity auto;
|
||||
|
||||
error_log /var/log/nginx/error.log;
|
||||
pid /run/nginx.pid;
|
||||
|
||||
include /usr/share/nginx/modules/*.conf;
|
||||
|
||||
events {
|
||||
use epoll;
|
||||
worker_connections 204800;
|
||||
}
|
||||
|
||||
http {
|
||||
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
|
||||
'$status $body_bytes_sent "$http_referer" '
|
||||
'"$http_user_agent" "$http_x_forwarded_for"';
|
||||
|
||||
access_log /var/log/nginx/access.log main;
|
||||
|
||||
sendfile on;
|
||||
tcp_nopush on;
|
||||
tcp_nodelay on;
|
||||
keepalive_timeout 65;
|
||||
types_hash_max_size 2048;
|
||||
|
||||
include /etc/nginx/mime.types;
|
||||
default_type application/octet-stream;
|
||||
|
||||
include /etc/nginx/conf.d/*.conf;
|
||||
|
||||
|
||||
proxy_connect_timeout 500ms;
|
||||
proxy_send_timeout 1000ms;
|
||||
proxy_read_timeout 3000ms;
|
||||
proxy_buffers 64 8k;
|
||||
proxy_busy_buffers_size 128k;
|
||||
proxy_temp_file_write_size 64k;
|
||||
proxy_redirect off;
|
||||
proxy_next_upstream error invalid_header timeout http_502 http_504;
|
||||
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Real-Port $remote_port;
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
|
||||
upstream n9e.monapi {
|
||||
server monapi:5800;
|
||||
keepalive 10;
|
||||
}
|
||||
|
||||
upstream n9e.index {
|
||||
server index:5830;
|
||||
keepalive 10;
|
||||
}
|
||||
|
||||
upstream n9e.transfer {
|
||||
server transfer:5810;
|
||||
keepalive 10;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 80 default_server;
|
||||
server_name _;
|
||||
root /usr/share/nginx/html;
|
||||
|
||||
# Load configuration files for the default server block.
|
||||
include /etc/nginx/conf.d/*.conf;
|
||||
|
||||
location / {
|
||||
root /home/n9e/pub;
|
||||
}
|
||||
|
||||
location /api/portal {
|
||||
proxy_pass http://n9e.monapi;
|
||||
}
|
||||
|
||||
location /api/index {
|
||||
proxy_pass http://n9e.index;
|
||||
}
|
||||
|
||||
location /api/transfer {
|
||||
proxy_pass http://n9e.transfer;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
#!/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
|
@ -0,0 +1 @@
|
||||
n9e-collector
|
@ -1 +0,0 @@
|
||||
sshd
|
@ -0,0 +1 @@
|
||||
n9e-monapi
|
@ -0,0 +1 @@
|
||||
n9e-transfer
|
@ -0,0 +1 @@
|
||||
n9e-tsdb
|
@ -0,0 +1 @@
|
||||
n9e-index
|
@ -0,0 +1 @@
|
||||
n9e-judge
|
@ -1 +0,0 @@
|
||||
{"version":3,"file":"index-3eb7c9ca4d88e3ad5c58.js","sources":["webpack:///index-3eb7c9ca4d88e3ad5c58.js"],"mappings":"AAAA;;;;;;;AAmsYA","sourceRoot":""}
|
File diff suppressed because one or more lines are too long
@ -0,0 +1 @@
|
||||
{"version":3,"file":"index-5c8cbf958683e20086f5.js","sources":["webpack:///index-5c8cbf958683e20086f5.js"],"mappings":"AAAA;;;;;;;AAmsYA","sourceRoot":""}
|
@ -1 +1 @@
|
||||
<!doctype html><html><head><meta charset="UTF-8"><title>Nightingale</title><link rel="shortcut icon" href="/favicon.ico"><link href="/index-3eb7c9ca4d88e3ad5c58.css" rel="stylesheet"></head><body><div id="react-content"></div><script src="/lib-033bee8514de110e36ef.dll.js"></script><script src="/index-3eb7c9ca4d88e3ad5c58.js"></script></body></html>
|
||||
<!doctype html><html><head><meta charset="UTF-8"><title>Nightingale</title><link rel="shortcut icon" href="/favicon.ico"><link href="/index-5c8cbf958683e20086f5.css" rel="stylesheet"></head><body><div id="react-content"></div><script src="/lib-033bee8514de110e36ef.dll.js"></script><script src="/index-5c8cbf958683e20086f5.js"></script></body></html>
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue