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

Add docker-compose.yml? #1

Open
ajoldham opened this issue Mar 13, 2019 · 2 comments
Open

Add docker-compose.yml? #1

ajoldham opened this issue Mar 13, 2019 · 2 comments

Comments

@ajoldham
Copy link

ajoldham commented Mar 13, 2019

Thanks for sharing this. Can you figure out how a Docker-Compose file would work for having localhost Persistent data?

The following works without persistent data.


version: '2'
services:
ansible-tower:
image: ansible-tower
ports:
- '443:443'

(Below commented out... )
' # volumes:
' # - "./cat_db:/var/lib/postgresql/9.6/main"
' # - "./cat_license:/etc/tower/license"

Thx!

@shawnsw
Copy link
Owner

shawnsw commented Mar 14, 2019

Hi @ajoldham

Your commented out code is trying to mount local host paths. The problem with mounting that way is you encounter permission problems.

You just need to remove the ./ in the paths, something like this:

volumes:
  - "cat_db:/var/lib/postgresql/9.6/main"
  - "cat_license:/etc/tower/license"

This will create and mount docker volumes rather than mounting your local paths.

@ajoldham
Copy link
Author

Thanks for the response. Looks like there's some discussion on it here:
docker/compose#3270

I tried to send my soul to computer hell by trying to run PostGres as root and 'chown -R root:root /var/lib/postgresql' :) to get around this... but failed.

I don't trust data files to be stored/backed/easily accessible up in a Docker Volume compared to just be stored natively on the Host... so if you come across a solution that allows the data files to be stored on the host in a simple docker-compose file... it would be appreciated.

Thx for listening!

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