新生成的jhipster应用未在产品模式下显示前端(404错误)

时间:2019-03-01 09:15:20

标签: angular docker jhipster

我生成了一个全新的jhipster应用程序,而没有涉及生成的源代码。之后,我使用命令进行构建(根据文档):

./gradlew -Pprod bootWar jibExportDockerContext && docker build -t
myimage build/jib-docker-context

一个docker镜像,并在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容器中无法运行)。我认为唯一有点令人困惑的是,从生产模式启动时,Hazelcast ist处于开发模式。

 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
    }
}

1 个答案:

答案 0 :(得分:0)

我不知道为什么,但是未将文件夹www复制到docker.gradle文件中定义的jibContext文件夹资源/静态文件中。创建上下文并将www文件夹手动复制到jib-docker-context / resources / static之后,构建docker映像,一切正常。

也许是个错误?