使用 dokku 在数字海洋上创建-反应-应用程序部署失败



我正在尝试使用dokku在数字海洋水滴上部署create-react-app。我在以前的部署中取得了成功,但是这个应用程序终于失败了。请帮助我解决问题。下面是我的包.json文件和dokku日志

多库日志.....

Enumerating objects: 465, done.
Counting objects: 100% (465/465), done.
Delta compression using up to 12 threads
Compressing objects: 100% (441/441), done.
Writing objects: 100% (465/465), 6.56 MiB | 1.87 MiB/s, done.
Total 465 (delta 162), reused 0 (delta 0)
remote: Resolving deltas: 100% (162/162), done.
-----> Cleaning up...
-----> Building jb from herokuish...
-----> Adding BUILD_ENV to build environment...
-----> Node.js app detected
-----> Creating runtime environment
NPM_CONFIG_LOGLEVEL=error
NODE_ENV=production
NODE_MODULES_CACHE=true
NODE_VERBOSE=false
-----> Installing binaries
engines.node (package.json):  14.3.0
engines.npm (package.json):   6.14.4
Resolving node version 14.3.0...
Downloading and installing node 14.3.0...
Bootstrapping npm 6.14.4 (replacing 6.14.5)...
npm 6.14.4 installed
-----> Installing dependencies
Installing node modules
> core-js@2.6.11 postinstall /tmp/build/node_modules/babel-runtime/node_modules/core-js
> node -e "try{require('./postinstall')}catch(e){}"

> fsevents@1.2.12 install /tmp/build/node_modules/fsevents
> node-gyp rebuild
make: Entering directory '/tmp/build/node_modules/fsevents/build'
SOLINK_MODULE(target) Release/obj.target/.node
COPY Release/.node
make: Leaving directory '/tmp/build/node_modules/fsevents/build'
> core-js@3.6.5 postinstall /tmp/build/node_modules/core-js
> node -e "try{require('./postinstall')}catch(e){}"

> core-js-pure@3.6.5 postinstall /tmp/build/node_modules/core-js-pure
> node -e "try{require('./postinstall')}catch(e){}"

> node-sass@4.14.1 install /tmp/build/node_modules/node-sass
> node scripts/install.js
Downloading binary from https://github.com/sass/node-sass/releases/download/v4.14.1/linux-x64-83_binding.node
Download complete
Binary saved to /tmp/build/node_modules/node-sass/vendor/linux-x64-83/binding.node
Caching binary to /tmp/npmcache.xZLNQ/_cacache/node-sass/4.14.1/linux-x64-83_binding.node
> node-sass@4.14.1 postinstall /tmp/build/node_modules/node-sass
> node scripts/build.js
Binary found at /tmp/build/node_modules/node-sass/vendor/linux-x64-83/binding.node
Testing binary
Binary is fine
added 2013 packages in 104.582s
-----> Build
Running build
> jeewitbachan@0.1.0 build /tmp/build
> NODE_ENV=production react-scripts build
Creating an optimized production build...
Compiled successfully.
File sizes after gzip:
127.29 KB  build/static/js/7.328a849a.chunk.js
47.8 KB    build/static/js/0.5abe17cc.chunk.js
19.23 KB   build/static/js/main.52fbfc8f.chunk.js
5.55 KB    build/static/css/7.31d7db73.chunk.css
2.11 KB    build/static/css/main.41b254e4.chunk.css
1.84 KB    build/static/js/8.7746b82b.chunk.js
1.8 KB     build/static/js/2.921fe7b4.chunk.js
1.61 KB    build/static/js/runtime-main.7b6f0658.js
1.48 KB    build/static/js/3.c310beb4.chunk.js
1.04 KB    build/static/css/2.db2e41ff.chunk.css
986 B      build/static/js/9.d50ea308.chunk.js
912 B      build/static/js/10.5ef69429.chunk.js
782 B      build/static/js/11.4fa4b5c3.chunk.js
526 B      build/static/js/4.7d8f5389.chunk.js
496 B      build/static/css/8.0a5c9922.chunk.css
392 B      build/static/js/12.23118763.chunk.js
338 B      build/static/js/1.719d2a52.chunk.js
308 B      build/static/css/10.eef0e758.chunk.css
307 B      build/static/css/9.eef0e758.chunk.css
The project was built assuming it is hosted at /.
You can control this with the homepage field in your package.json.
The build folder is ready to be deployed.
You may serve it with a static server:
npm install -g serve
serve -s build
Find out more about deployment here:
bit.ly/CRA-deploy

-----> Caching build
- node_modules
-----> Pruning devDependencies
audited 2513 packages in 26.269s
62 packages are looking for funding
run `npm fund` for details
found 2 low severity vulnerabilities
run `npm audit fix` to fix them, or `npm audit` for details
-----> Build succeeded!
-----> Discovering process types
Procfile declares types -> web
-----> Releasing jb (dokku/jb:latest)...
-----> Deploying jb (dokku/jb:latest)...
-----> App Procfile file found (/home/dokku/jb/DOKKU_PROCFILE)
-----> DOKKU_SCALE file not found in app image. Generating one based on Procfile...
DOKKU_SCALE declares scale -> web=1
=====> Processing deployment checks
No CHECKS file found. Simple container checks will be performed.
For more efficient zero downtime deployments, create a CHECKS file. See http://dokku.viewdocs.io/dokku/deployment/zero-downtime-deploys/ for examples
-----> Attempting pre-flight checks (web.1)
Waiting for 10 seconds ...
remote: App container failed to start!!
=====> jb web container output:
> jeewitbachan@0.1.0 start /app
> react-scripts start
ℹ 「wds」: Project is running at http://172.17.0.4/
ℹ 「wds」: webpack output is served from 
ℹ 「wds」: Content not from webpack is served from /app/public
ℹ 「wds」: 404s will fallback to /
Starting the development server...
=====> end jb web container output
To 165.227.87.8:jb
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'dokku@165.227.87.8:jb'

包.json 文件

{
"name": "jeewitbachan",
"version": "0.1.0",
"engines": {
"node": "14.3.0",
"npm": "6.14.4"
},
"private": true,
"dependencies": {
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.3.2",
"@testing-library/user-event": "^7.1.2",
"install": "^0.13.0",
"node-sass": "^4.14.1",
"npm": "^6.14.4",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"react-helmet": "^6.0.0",
"react-html-parser": "^2.0.2",
"react-icons": "^3.10.0",
"react-redux": "^7.2.0",
"react-router-dom": "^5.2.0",
"react-scripts": "3.4.1",
"redux": "^4.0.5",
"redux-logger": "^3.0.6",
"redux-persist": "^6.0.0",
"redux-thunk": "^2.3.0",
"reselect": "^4.0.0",
"styled-components": "^5.1.1",
},
"scripts": {
"start": "react-scripts start",
"dev": "NODE_ENV=development react-scripts start",
"build": "NODE_ENV=production react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}

注意:- 我注意到在 dokku 日志上我说"正在启动开发服务器......"这是否意味着它仍然以开发模式部署,或者我做错了什么?

在降级到"反应脚本"后,我终于解决了这个问题:"3.4.0"。是的!!

相关内容

最新更新