Closed jhjacobs81 closed 3 years ago
never mind, fixed that!
now i get:
app_1 | rake aborted! app_1 | PG::ConnectionBad: could not connect to server: Connection refused app_1 | Is the server running on host "localhost" (127.0.0.1) and accepting app_1 | TCP/IP connections on port 5432? app_1 | could not connect to server: Address not available app_1 | Is the server running on host "localhost" (::1) and accepting app_1 | TCP/IP connections on port 5432?
okay so, i had to set the host to the ip of the host (so instead of localhost in the .env file i had to put 192.xxx.xxx.xxx there), set the database environemtn to production (otherwise it would keep connecting to localhost) and run the command: docker-compose run app bundle exec rake db:drop db:migrate db:setup DISABLE_DATABASE_ENVIRONMENT_CHECK=1
never mind, fixed that!
now i get:
app_1 | rake aborted! app_1 | PG::ConnectionBad: could not connect to server: Connection refused app_1 | Is the server running on host "localhost" (127.0.0.1) and accepting app_1 | TCP/IP connections on port 5432? app_1 | could not connect to server: Address not available app_1 | Is the server running on host "localhost" (::1) and accepting app_1 | TCP/IP connections on port 5432?
Do you mind sharing how you managed to fix the entrypoint issue?
oh sorry! it has to do with the docker-compose file.. i'll post mine hang on :)
this is my new docker-compose.yml
it had to do with the app directory, and with PostgreSQL not working if i didnt set the ports..
version: '3.7' services: postgres: image: postgres env_file: .env volumes:
also, in .env i had to set the host IP where 192.168.1.12 is the external IP of the docker host, like so:
ENCRYPTION_KEY=HIDDEN POSTGRES_HOST=192.168.1.12 POSTGRES_USER=postgres POSTGRES_PASSWORD=postgres POSTGRES_DB=wreeto_db RACK_ENV=production RAILS_ENV=production RAILS_MASTER_KEY=HIDDEN REDIS_HOST=192.168.1.12 REDIS_PASSWORD= SMTP_USERNAME= SMTP_PASSWORD= WREETO_HOST=192.168.1.12 WREETO_PORT=8383
Thanks! Got it worked now 👍
So, i did everything the readme says. Created the .env file, created the docker-entrypoint.sh file, set the right chmod modes, but when i start the container this is what i end with:
ERROR: for wreeto_app_1 Cannot start service app: OCI runtime create failed: container_linux.go:367: starting container process caused: exec: "./docker-entrypoint.sh": stat ./docker-entrypoint.sh: no such file or directory: unknown
ERROR: for app Cannot start service app: OCI runtime create failed: container_linux.go:367: starting container process caused: exec: "./docker-entrypoint.sh": stat ./docker-entrypoint.sh: no such file or directory: unknown ERROR: Encountered errors while bringing up the project.
the docker-entrypoint.sh file is in the same dir as the docker-compose.yml file!