Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Persisting storage issue #15

Open
stoltzmaniac opened this issue Feb 13, 2019 · 7 comments
Open

Persisting storage issue #15

stoltzmaniac opened this issue Feb 13, 2019 · 7 comments

Comments

@stoltzmaniac
Copy link
Owner

Any ideas @tompropst about why I can't get web-db to work as a volume?

After I add the volumes section:

web-db:
    container_name: web-db
    build:
      context: ./project/server/db
      dockerfile: Dockerfile
    ports:
      - 5435:5432
    environment:
      - POSTGRES_USER=${POSTGRES_USER}
      - POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
    volumes:
      - ./backup_data/postgres:/var/lib/postgresql/data

I get an error:

Waiting for postgres...
web-db: forward host lookup failed: Unknown host
web-db: forward host lookup failed: Unknown host
....goes on like this...

Any ideas?

@tompropst
Copy link
Contributor

The files at that path in the container my need to be copied on the first build, before mounting the local path which is probably empty. The unknown host error may be from some default setting. I’m out of the county this week but can help debug when I get back.

@stoltzmaniac
Copy link
Owner Author

Also, when I run the create-db command I wind up getting an error:

sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) could not translate host name "web-db" to address: Name or service not known
 (Background on this error at: http://sqlalche.me/e/e3q8)

I'm assuming they're related

@stoltzmaniac
Copy link
Owner Author

Aaaand as I just tried, looks like what I had to do was write to a different directory on the container because it was not empty (or I could have removed it).

@stoltzmaniac
Copy link
Owner Author

I lied, still an issue... can't get this thing to mount

@stoltzmaniac
Copy link
Owner Author

After many stressful hours, I think I've found the problem... and it was very simple...

The volume is being referenced via a relative path that lives within the root directory. If I change it to somewhere else on the system it works... could that be accurate?

@tompropst
Copy link
Contributor

I’m not sure. Are you saying that the host path ./backup_data/postgres caused the issue? Seems odd.

@stoltzmaniac
Copy link
Owner Author

Yeah, I'm not sure. Honestly, just can't seem to get volumes to work smoothly here. Database isn't persisting and then it pulls that can't connect stuff if I use a volume that was given in the example above

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants