Docker Image not respecting ENV variable for Postgres config
When launching a docker container using postgres the Environment Variables appear to not be respected and the instance is trying to connect to localhost with default credentials.
Docker Logs:
Couldn't create database for {"host"=>"localhost", "adapter"=>"postgresql", "encoding"=>"unicode", "database"=>"arachni_production", "pool"=>50, "username"=>"arachni", "password"=>"secret"}
rake aborted!
PG::ConnectionBad: could not connect to server: Connection refused
Is the server running on host "localhost" (127.0.0.1) and accepting TCP/IP connections on port 5432? could not connect to server: Cannot assign requested address
Is the server running on host "localhost" (::1) and accepting TCP/IP connections on port 5432?
From Docker-Compose:
arachni: container_name: arachni image: arachni/arachni:latest environment: DB_ADAPTER: postgresql DB_HOST: arachni_postgresdb DB_NAME: arachnidb DB_USER: arachnidb DB_PASS: PASSWORD ports: - 222:22 - 7331:7331 - 9292:9292
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
1 Posted by Umbrae on 16 Jun, 2020 05:54 PM
As FYI:
This is my current docker project. I can get it working with the default internal DB, so the postgres code is commented out.
https://github.com/umbraesoulsbane/arachni-docked