我生成了一个全新的jhipster应用程序而没有触及生成的源代码。之后我使用命令构建(根据文档):
./gradlew -Pprod bootWar jibExportDockerContext && docker build -t
myimage build/jib-docker-context
一个码头图像并在docker中启动。但我无法达到角度前端。它给出了以下控制台输出的404错误
A parser-blocking, crosssite (i.e. different eTLD+1) script,
https://linkhelp.clients.google.com/tbproxy/lh/wm?sourceid=wm&url=http%3A%2F%2Flocalhost%3A8080%2F&hl=de&site=localhost%3A8080&error=http404&js=true,
is invoked via document.write. The network request for this script MAY
be blocked by the browser in this or a future page load due to poor
network connectivity. If blocked in this page load, it will be
confirmed in a subsequent console message. See
https://www.chromestatus.com/feature/5718547946799104 for more
details.
Qc @ fixurl.js:142
ke @ fixurl.js:143
(anonymous) @ fixurl.js:143
在构建和启动图像(容器)期间,没有错误。后端(管理/健康)可以通过卷曲到达。在开发模式下启动应用程序正在运行(但不在docker容器中)。我认为唯一令人困惑的是,当在prod模式下启动时,Hazelcast处于开发模式。
jhipster-app_1 | 2019-03-01 09:04:30.981 INFO 1 --- [
main] com.hazelcast.system : [172.21.0.3]:5701
[dev] [3.9.4] Hazelcast 3.9.4 (20180420 - b8001d5) starting at
[172.21.0.3]:5701
jhipster-app_1 | 2019-03-01 09:04:30.982 INFO 1 --- [ main] com.hazelcast.system : [172.21.0.3]:5701
[dev] [3.9.4] Copyright (c) 2008-2018, Hazelcast, Inc. All Rights
Reserved.
jhipster-app_1 | 2019-03-01 09:04:30.983 INFO 1 --- [ main] com.hazelcast.system : [172.21.0.3]:5701
[dev] [3.9.4] Configured Hazelcast Serialization version: 1
jhipster-app_1 | 2019-03-01 09:04:31.283 INFO 1 --- [ main] c.h.s.i.o.impl.BackpressureRegulator : [172.21.0.3]:5701
[dev] [3.9.4] Backpressure is disabled
jhipster-app_1 | 2019-03-01 09:04:31.840 INFO 1 --- [ main] com.hazelcast.instance.Node : [172.21.0.3]:5701
[dev] [3.9.4] Creating MulticastJoiner
jhipster-app_1 | 2019-03-01 09:04:32.027 INFO 1 --- [ main] c.h.s.i.o.impl.OperationExecutorImpl : [172.21.0.3]:5701
[dev] [3.9.4] Starting 2 partitio`enter code here`n threads and 3
generic threads (1 dedicated for priority tasks)
jhipster-app_1 | 2019-03-01 09:04:32.042 INFO 1 --- [ main] c.h.internal.diagnostics.Diagnostics : [172.21.0.3]:5701
[dev] [3.9.4] Diagnostics disabled. To enable add
-Dhazelcast.diagnostics.enabled=true to the JVM arguments.
jhipster-app_1 | 2019-03-01 09:04:32.052 INFO 1 --- [ main] com.hazelcast.core.LifecycleService : [172.21.0.3]:5701
[dev] [3.9.4] [172.21.0.3]:5701 is STARTING
jhipster-app_1 | 2019-03-01 09:04:34.329 INFO 1 --- [ main] com.hazelcast.system : [172.21.0.3]:5701
[dev] [3.9.4] Cluster version set to 3.9
jhipster-app_1 | 2019-03-01 09:04:34.330 INFO 1 --- [ main] c.h.internal.cluster.ClusterService : [172.21.0.3]:5701
[dev] [3.9.4]
JHipster v5.8.2 H2 (dev) postgres (prod)
yo-rc.json:
{
"generator-jhipster": {
"promptValues": {
"packageName": "com.mycompany.myapp"
},
"jhipsterVersion": "5.8.2",
"applicationType": "monolith",
"baseName": "testapp",
"packageName": "com.mycompany.myapp",
"packageFolder": "com/mycompany/myapp",
"serverPort": "8080",
"authenticationType": "jwt",
"cacheProvider": "hazelcast",
"enableHibernateCache": true,
"websocket": false,
"databaseType": "sql",
"devDatabaseType": "h2Disk",
"prodDatabaseType": "postgresql",
"searchEngine": false,
"messageBroker": false,
"serviceDiscoveryType": false,
"buildTool": "gradle",
"enableSwaggerCodegen": false,
"jwtSecretKey": "deleted",
"clientFramework": "angularX",
"useSass": true,
"clientPackageManager": "npm",
"testFrameworks": [],
"jhiPrefix": "jhi",
"entitySuffix": "",
"dtoSuffix": "DTO",
"otherModules": [],
"enableTranslation": false
}
}
我不知道为什么,但文件夹www没有复制到docker.gradle文件中定义的jibContext文件夹资源/静态。创建上下文并手动将www文件夹复制到jib-docker-context / resources / static后,构建docker镜像可以正常工作。
也许是一个错误?