Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upGetting Diesel to connect from a Docker container to a Postgres instance via docker-compose #1218
Comments
This comment has been minimized.
|
I don't know enough about docker to help with your issue, but you can use |
This comment has been minimized.
ghotiphud
commented
Oct 14, 2017
|
Docker compose doesn't wait for the DB container to start up. Try https://github.com/vishnubob/wait-for-it |
This comment has been minimized.
ghotiphud
commented
Oct 14, 2017
|
Example use in this repo https://github.com/ghotiphud/rust-web-starter |
This comment has been minimized.
alexanderbanks
commented
Oct 16, 2017
|
@ghotiphud thanks for the response. I actually took the seemingly simpler approach of running We can close this, I apologize for not responding to @sgrif . All is well. |
sgrif
closed this
Oct 16, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
alexanderbanks commentedSep 29, 2017
Setup
I'm trying to run a Diesel/Iron app that connects to a Postgres instance. For development I'm trying to use Docker/Docker-Compose. This might not be a bug with Diesel (it probably isn't), but I was curious if the Diesel maintainers might have some insight into setting this up properly?
Versions
In terms of versions, I'm using the official Rust Docker image, version rust:1.19.0, postgres:9.6.
What are you trying to accomplish?
The dockerfile looks like this:
With a docker-compose file:
The env file:
What is the expected output?
Diesel connects to the postgres image just like it would a postgres image not on a local network
What is the actual output?
It appears that Diesel isn't resolving db into its actual IP? But that might make sense? Because the image hasn't been created,so there isn't a configuration setup yet to convert
dbto an IP?Are you seeing any additional errors?
Nope, that's the only one. I had it working prior to using diesel/infer_schema.
Steps to reproduce
It fails while building the web image, so using the above config will never successfully build an image.
Again, I doubt this is an error with Diesel, I'm mostly just looking for help? I figured submitting an issue might be the best way define the problem?