新增docker-compose脚本

This commit is contained in:
aoshiguchen
2024-10-25 21:39:12 +08:00
parent 98ab8fd3d0
commit 0006a33a5d
8 changed files with 307 additions and 0 deletions
@@ -0,0 +1,58 @@
server:
# 服务端web端口,用于支持HTTP接口,管理后台页面访问
port: 8888
# 日志级别
solon.logging:
logger:
"root":
level: info
appender:
file:
level: info
neutrino:
proxy:
# 隧道相关配置-用于维持服务端与客户端的通信
tunnel:
# 线程池相关配置,用于技术调优,可忽略
boss-thread-count: 2
work-thread-count: 10
# 隧道非SSL端口
port: 9000
# 隧道SSL端口
ssl-port: 9002
# 隧道SSL证书配置
key-store-password: 123456
key-manager-password: 123456
jks-path: classpath:/test.jks
# 是否开启隧道传输报文日志(日志级别为debug时开启才有效)
transfer-log-enable: false
# 是否开启心跳日志
heartbeat-log-enable: false
server:
tcp:
# 线程池相关配置,用于技术调优,可忽略
boss-thread-count: 5
work-thread-count: 20
# http代理端口,默认80(不配置不支持)
http-proxy-port: 80
# https代理端口,默认443 (不配置不支持,同时需要配置域名、证书)
https-proxy-port: 443
# 是否开启代理服务报文日志(日志级别为debug时开启才有效)
transfer-log-enable: false
udp:
# 线程池相关配置,用于技术调优,可忽略
boss-thread-count: 5
work-thread-count: 20
# 是否开启代理服务报文日志(日志级别为debug时开启才有效)
transfer-log-enable: false
data:
db:
# 数据库类型,目前支持h2、mysql、mariadb
type: mysql
# 数据库连接URL
url: jdbc:mysql://mysql:3306/neutrino-proxy?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true&useAffectedRows=true&useSSL=false
# 数据库用户名
username: root
# 数据库密码
password: 123456
@@ -0,0 +1,21 @@
-- Licensed to the Apache Software Foundation (ASF) under one
-- or more contributor license agreements. See the NOTICE file
-- distributed with this work for additional information
-- regarding copyright ownership. The ASF licenses this file
-- to you under the Apache License, Version 2.0 (the
-- "License"); you may not use this file except in compliance
-- with the License. You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-- this file works for MySQL.
set names utf8mb4;
create database if not exists `neutrino-proxy` default charset utf8mb4 collate utf8mb4_general_ci;
commit;
@@ -0,0 +1,48 @@
version: '3.8'
networks:
npServer:
driver: bridge
services:
mysql:
image: mysql:8
container_name: compose-mysql
hostname: mysql
restart: always
healthcheck:
test: ['CMD-SHELL', 'mysqladmin ping -h 127.0.0.1 --silent']
interval: 3s
retries: 5
start_period: 3m
ports:
- "3308:3306"
environment:
TZ: Asia/Shanghai
MYSQL_ROOT_PASSWORD: 123456
volumes:
- ./data/mysqldata:/var/lib/mysql/
- ./config/sql:/docker-entrypoint-initdb.d/
networks:
- npServer
npServer:
image: aoshiguchen/neutrino-proxy-server:latest
container_name: compose-npServer
hostname: npServer
restart: always
environment:
TZ: Asia/Shanghai
LANG: zh_CN.UTF-8
depends_on:
mysql:
condition: service_healthy
volumes:
- ./config:/root/neutrino-proxy/config
- ./data:/root/neutrino-proxy/data
- ./logs:/root/neutrino-proxy/logs
ports:
- "8888:8888"
- "9000:9000"
- "9002:9002"
- "9101-9120:9101-9120"
networks:
- npServer