Comments (10)
Your error states the reason right here:
ERROR: for fastapi-react-project_postgres_1 Cannot start service postgres: driver failed programming external connectivity on endpoint fastapi-react-project_postgres_1 (31ccd7b0ce884e6658231ae13ef1be29c5c34888676df38322930a3cdbcb67ed): Bind for 0.0.0.0:5432 failed: port is already allocated
port 5432 cannot open, perhaps another service is running on that port or a firewall is blocking its access?
from fastapi-react.
I can confirm that I'm getting the same issue:
Step 5/12 : RUN npm install -g [email protected]
---> Running in 9501a907a35c
npm notice
npm notice New patch version of npm available! 7.0.3 -> 7.0.5
npm notice Changelog: <https://github.com/npm/cli/releases/tag/v7.0.5>
npm notice Run `npm install -g [email protected]` to update!
npm notice
npm ERR! code EXDEV
npm ERR! syscall rename
npm ERR! path /usr/local/lib/node_modules/npm
npm ERR! dest /usr/local/lib/node_modules/.npm-i9nnxROI
npm ERR! errno -18
npm ERR! EXDEV: cross-device link not permitted, rename '/usr/local/lib/node_modules/npm' -> '/usr/local/lib/node_modules/.npm-i9nnxROI'
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2020-10-25T17_36_33_620Z-debug.log
from fastapi-react.
@Buuntu I recommend that the node image for frontend/Dockerfile
be pinned to node:14
for now.
Unless, of course, you have a better solution.
from fastapi-react.
@robertosannazzaro just some "drive-by" debugging. Still on the learning curve myself.
My intuition is that this should be pinned as closely as possible to the most recent LTS release which is 12.19.0 at the moment.
So maybe node:12
in the Dockerfile.
from fastapi-react.
Thanks @JasonHoku, however, this error is generated further. I have stopped all containers and tried from scratch. I can actually connect to postgre using a SQL IDE, but the error I get is originated in the frontend, not in the backend services:
❯ chmod +x scripts/build.sh
./scripts/build.sh
Building frontend
Step 1/11 : FROM node:latest
---> ca36fba5ad66
Step 2/11 : ADD package.json /package.json
---> Using cache
---> 0ad31658dcc7
Step 3/11 : ENV NODE_PATH=/node_modules
---> Using cache
---> 896cfd31e188
Step 4/11 : ENV PATH=$PATH:/node_modules/.bin
---> Using cache
---> 1550e86f7f79
Step 5/11 : RUN npm install
---> Running in 97d46fc9c1d2
npm notice
npm notice New patch version of npm available! 7.0.3 -> 7.0.5
npm notice Changelog: <https://github.com/npm/cli/releases/tag/v7.0.5>
npm notice Run `npm install -g [email protected]` to update!
npm notice
npm ERR! Maximum call stack size exceeded
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2020-10-25T08_57_52_370Z-debug.log
ERROR: Service 'frontend' failed to build : The command '/bin/sh -c npm install' returned a non-zero code: 1
Creating dandalo-insta-wordcloud_backend_run ... done
INFO [alembic.runtime.migration] Context impl PostgresqlImpl.
INFO [alembic.runtime.migration] Will assume transactional DDL.
Creating dandalo-insta-wordcloud_backend_run ... done
Creating superuser [email protected]
Superuser created
then:
❯ docker-compose up -d
Building frontend
Step 1/11 : FROM node:latest
---> ca36fba5ad66
Step 2/11 : ADD package.json /package.json
---> Using cache
---> 0ad31658dcc7
Step 3/11 : ENV NODE_PATH=/node_modules
---> Using cache
---> 896cfd31e188
Step 4/11 : ENV PATH=$PATH:/node_modules/.bin
---> Using cache
---> 1550e86f7f79
Step 5/11 : RUN npm install
---> Running in 70f26ead488d
npm notice
npm notice New patch version of npm available! 7.0.3 -> 7.0.5
npm notice Changelog: <https://github.com/npm/cli/releases/tag/v7.0.5>
npm notice Run `npm install -g [email protected]` to update!
npm notice
npm ERR! Maximum call stack size exceeded
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2020-10-25T08_59_13_818Z-debug.log
ERROR: Service 'frontend' failed to build : The command '/bin/sh -c npm install' returned a non-zero code: 1
from fastapi-react.
Hi @pigeonflight, I have also got the same error when trying to update npm with the suggested command npm install -g [email protected]
from fastapi-react.
@robertosannazzaro
I found a solution that works for me:
Edit frontend/Dockerfile
and change the image from node:latest
to node:14
.
I think the issue is being caused by a newer version of the node image.
from fastapi-react.
@pigeonflight thanks, I have managed to run it!
However, maybe something better can be done: using node:14
leads to a lot of warnings:
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/react-scripts/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules/jest-haste-map/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN notsup Unsupported engine for [email protected]: wanted: {"node":"<8.10.0"} (current: {"node":"14.14.0","npm":"6.14.8"})
npm WARN notsup Not compatible with your version of node/npm: [email protected]
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules/watchpack-chokidar2/node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules/webpack-dev-server/node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN [email protected] requires a peer of immutable@^3.8.1 || ^4.0.0-rc.1 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of seamless-immutable@^7.1.3 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of eslint-plugin-import@^2.21.2 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of eslint-plugin-jsx-a11y@^6.3.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of eslint-plugin-react@^7.20.0 but none is installed. You must install peer dependencies yourself.
npm WARN @testing-library/[email protected] requires a peer of @testing-library/dom@>=7.21.4 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of eslint-plugin-import@^2.21.2 but none is installed. You must install peer dependencies yourself.
I'm not an expert with npm
and node, but I'm trying to give my two cents.
from fastapi-react.
@robertosannazzaro just some "drive-by" debugging. Still on the learning curve myself.
My intuition is that this should be pinned as closely as possible to the most recent LTS release which is 12.19.0 at the moment.
So maybenode:12
in the Dockerfile.
I would accept a PR for this @pigeonflight
from fastapi-react.
Fixed in #149
from fastapi-react.
Related Issues (20)
- Depreciation message in chrome HOT 1
- Nginx and frontend containers don't start
- [FEATURE REQUEST] Authentication to use HttpOnly Cookie instead of Local Storage tokens
- 'unknown' is not assignable to parameter of type 'SetStateAction<string>'. HOT 5
- cannot load localhost:8000 HOT 1
- Duplicate Superuser with same email
- Integrate SQLModel
- incompatibility between react-scripts and typescript versions HOT 1
- Any plans to upgrade to SQLAlchemy 1.4+ HOT 1
- click doesn't work on Frontend HOT 2
- Typescript errors on default install/up HOT 3
- Switch component shouldn't have div as children
- Frontend build faild HOT 2
- Fresh build- front end errors HOT 3
- Types and versions HOT 1
- Access to fetch at 'http://localhost:8000/api/v1' from origin 'http://0.0.0.0:8000' has been blocked by CORS policy HOT 1
- is this project dead? HOT 2
- ImportError: cannot import name 'WebSocketException' from 'starlette.exceptions' (/opt/homebrew/lib/python3.9/site-packages/starlette/exceptions.py) HOT 2
- Front end does not respond to mouse. HOT 3
- Typescript error 'Router' cannot be used as a JSX component. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fastapi-react.