Open AhmedWagdi1 opened 9 months ago
Default port for poatgres is 5432 not 55432
it worked after changing mapping to default port ,, thank you
but now it is not creating the user as expected . i get
xtechDB | 2024-02-06 13:55:51.451 UTC [35] FATAL: password authentication failed for user "xtechdbuser"
xtechDB | 2024-02-06 13:55:51.451 UTC [35] DETAIL: Role "xtechdbuser" does not exist.```
Ahmed, Try with the default settings first.
For example:
docker-compose up
(note: the strapi-tools-dockerize project will generate new keys in the .env file everytime it is setup)docker-compose up
docker build
on the Dockerfile.prod, then publishing it to a docker container registry, and specifying the published image as the strapi container to use, in the docker-compose.yml file.You'll need to set these items as env vars, in the .env file. For "someKeyFromRandomKeyGenerator" I recommend using a key generator to generate a random key for those items.
These are all the items you'll need in the .env file. And this assumes you have the project use postgres as the database.
DATABASE_CLIENT=postgres
DATABASE_HOST=localhost
DATABASE_NAME=strapi
DATABASE_USERNAME=strapi
DATABASE_PASSWORD=someGoodPassword
DATABASE_PORT=5432
JWT_SECRET=someKeyFromRandomKeyGenerator
ADMIN_JWT_SECRET=someKeyFromRandomKeyGenerator
NODE_ENV=development
# has to be 0.0.0.0 to be reached by laptop running locally
HOST=0.0.0.0
# HOST=localhost
PORT=1337
APP_KEYS=someKeyFromRandomKeyGenerator1,someKeyFromRandomKeyGenerator2,someKeyFromRandomKeyGenerator3,someKeyFromRandomKeyGenerator4
API_TOKEN_SALT=someKeyFromRandomKeyGenerator
TRANSFER_TOKEN_SALT=someKeyFromRandomKeyGenerator
🐛 Bug Report
Im have this error when i try to run
docker compose up --build
: Error: connect ECONNREFUSED 172.18.0.2:55432 at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1555:16)🤷♀️ What did you do
i have used the tool to generate the
dockerfile
anddocker-compose.yaml
file .. then i tried to run the app usingdocker compose up --build
, defined hosts for db aslocalhost
and port as55432
my docker compose file :
⛔️ Error log
Error: connect ECONNREFUSED 172.18.0.2:55432 at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1555:16)
🕵️♀️ Stack trace