更新环境变量
This commit is contained in:
9
.dockerignore
Normal file
9
.dockerignore
Normal file
@@ -0,0 +1,9 @@
|
||||
.dockerignore
|
||||
Dockerfile
|
||||
build/
|
||||
.dart_tool/
|
||||
.git/
|
||||
.github/
|
||||
.gitignore
|
||||
.idea/
|
||||
.packages
|
||||
17
Dockerfile
Normal file
17
Dockerfile
Normal file
@@ -0,0 +1,17 @@
|
||||
# Use latest stable channel SDK.
|
||||
FROM dart:3.5.4 AS build
|
||||
LABEL qmqz=admin@ipayl.com
|
||||
|
||||
# Resolve app dependencies.
|
||||
WORKDIR /app
|
||||
COPY pubspec.* ./
|
||||
RUN export PUB_HOSTED_URL=https://pub.flutter-io.cn && dart pub get
|
||||
|
||||
ADD bin /app/bin
|
||||
RUN dart compile exe bin/main.dart -o bin/server
|
||||
|
||||
FROM scratch
|
||||
COPY --from=build /runtime/ /
|
||||
COPY --from=build /app/bin/server /app/bin/
|
||||
|
||||
CMD ["/app/bin/server"]
|
||||
@@ -10,7 +10,6 @@ import './controller/AreaController.dart';
|
||||
|
||||
import 'const/ServiceConstant.dart';
|
||||
|
||||
|
||||
import './const/CommonVariables.dart';
|
||||
|
||||
void main(List<String> args) async {
|
||||
@@ -21,14 +20,34 @@ Future<void> initEasyDartModule() async {
|
||||
try {
|
||||
String? web = Platform.environment["web_port"] ?? "9200";
|
||||
List<String> redis =
|
||||
(Platform.environment["redis"] ?? "127.0.0.1:6379").split(":");
|
||||
if (redis.length == 1) {
|
||||
redis.add("6379");
|
||||
(Platform.environment["redis"] ?? "default@localhost:6379/0")
|
||||
.split(":");
|
||||
String host;
|
||||
int port = 6379;
|
||||
String? password;
|
||||
int db = 0;
|
||||
var hs = redis[0].split("@");
|
||||
if (hs.length == 2) {
|
||||
host = hs[1];
|
||||
if (hs[0] != "default") {
|
||||
password = hs[0];
|
||||
}
|
||||
} else {
|
||||
host = hs[0];
|
||||
}
|
||||
var pd = redis[1].split("/");
|
||||
if (pd.length == 2) {
|
||||
db = int.parse(pd[1]);
|
||||
port = int.parse(pd[0]);
|
||||
} else {
|
||||
port = int.parse(pd[0]);
|
||||
}
|
||||
|
||||
EasyDartModule.init(
|
||||
loggerConfig: LoggerConfig(
|
||||
host: ServiceConstant.logService, serviceName: "快检报告服务"),
|
||||
redisConfig: RedisConfig(host: redis[0], port: int.parse(redis[1])),
|
||||
redisConfig: RedisConfig(
|
||||
host: host, port: port, database: db, password: password),
|
||||
webSocketConfig:
|
||||
WebSocketConfig(ServiceConstant.webSocketService, (data) {
|
||||
// 接收到服务消息
|
||||
|
||||
2
build.bat
Normal file
2
build.bat
Normal file
@@ -0,0 +1,2 @@
|
||||
@echo off
|
||||
docker build -t 10.20.2.5:5000/kuaijian .
|
||||
16
pubspec.lock
16
pubspec.lock
@@ -6,7 +6,7 @@ packages:
|
||||
description:
|
||||
path: "."
|
||||
ref: master
|
||||
resolved-ref: a34d58f93eb692c976d1be165920a03a54dea027
|
||||
resolved-ref: e21033bc10973d40ff9cd4369a1efb9f7c30b0bb
|
||||
url: "https://git.he-info.cn/qmqz/easy_dart_module.git"
|
||||
source: git
|
||||
version: "1.0.0"
|
||||
@@ -14,15 +14,15 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: _fe_analyzer_shared
|
||||
sha256: "16e298750b6d0af7ce8a3ba7c18c69c3785d11b15ec83f6dcd0ad2a0009b3cab"
|
||||
sha256: "45cfa8471b89fb6643fe9bf51bd7931a76b8f5ec2d65de4fb176dba8d4f22c77"
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "76.0.0"
|
||||
version: "73.0.0"
|
||||
_macros:
|
||||
dependency: transitive
|
||||
description: dart
|
||||
source: sdk
|
||||
version: "0.3.3"
|
||||
version: "0.3.2"
|
||||
adaptive_number:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -35,10 +35,10 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: analyzer
|
||||
sha256: "1f14db053a8c23e260789e9b0980fa27f2680dd640932cae5e1137cce0e46e1e"
|
||||
sha256: "4959fec185fe70cce007c57e9ab6983101dbe593d2bf8bbfb4453aaec0cf470a"
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "6.11.0"
|
||||
version: "6.8.0"
|
||||
args:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -371,10 +371,10 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: macros
|
||||
sha256: "1d9e801cd66f7ea3663c45fc708450db1fa57f988142c64289142c9b7ee80656"
|
||||
sha256: "0acaed5d6b7eab89f63350bccd82119e6c602df0f391260d0e32b5e23db79536"
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "0.1.3-main.0"
|
||||
version: "0.1.2-main.4"
|
||||
matcher:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
name: report_data_service
|
||||
description: A sample command-line application.
|
||||
version: 1.0.0
|
||||
publish_to: none
|
||||
# repository: https://github.com/my_org/my_repo
|
||||
|
||||
environment:
|
||||
|
||||
Reference in New Issue
Block a user