reactjs / server-components-demo

Demo app of React Server Components.
https://reactjs.org/server-components
MIT License
4.27k stars 640 forks source link

docker doesn't work #11

Closed ynifamily3 closed 3 years ago

ynifamily3 commented 3 years ago
image

postgres_1 | /usr/local/bin/docker-entrypoint.sh: sourcing /docker-entrypoint-initdb.d/init_db.sh postgres_1 | 2020-12-22 06:31:21.349 UTC [70] ERROR: role "notesadmin" already exists postgres_1 | 2020-12-22 06:31:21.349 UTC [70] STATEMENT: CREATE ROLE notesadmin WITH LOGIN PASSWORD 'password'; postgres_1 | ERROR: role "notesadmin" already exists

waqasnoor commented 3 years ago

The error says that notesadmin user already exists in your postgres db. so i think you should just remove the CREATE ROLE notesadmin WITH LOGIN PASSWORD 'password'; line from scripts/init_db.sh file and it should start working for you.

xAl3xFx commented 3 years ago

Having the same problem, except I don't have the error with existing user. image Tried both ports 3000 and 4000 with no difference.

Windows 10 Node v15.4.0

migueloller commented 3 years ago

FWIW, removing the network_mode option from docker-compose.yml made it work for me, but then the issue is that it can't find Postgres at port 5432.

poteto commented 3 years ago

Does https://github.com/reactjs/server-components-demo/pull/10 work for you all?

jonjaques commented 3 years ago

Do note that when running docker-compose up & down, postgres container only runs the init script when first starting up, so you need to run docker-compose down -v to also remove the data volume first if you have faced this issue.

migueloller commented 3 years ago

@poteto, #10 did work for me!

poteto commented 3 years ago

Gonna close this since we have a possible fix in #10. Please feel free to reopen if it's still broken.

liuxiaocong commented 3 years ago

image