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

Update docker-compose to persist postgres data #21

Merged
merged 1 commit into from Mar 13, 2020

Conversation

bheemreddy181-zz
Copy link
Contributor

@bheemreddy181-zz bheemreddy181-zz commented Mar 9, 2020

Description :

Typically we don't have to clean up Postgres data whenever we bring down the Postgres service in general unless there is a different use-case we want to achieve.

  • What are we changing here?
    Updating Docker compose to use volumes for Postgres so that every time we bring back the docker services we use the existing volume on the system.
Logs will look like below

pact_broker_1  | Puma starting in single mode...
pact_broker_1  | * Version 3.12.2 (ruby 2.6.4-p104), codename: Llamas in Pajamas
pact_broker_1  | * Min threads: 0, max threads: 16
postgres_1     |
postgres_1     | PostgreSQL Database directory appears to contain a database; Skipping initialization
postgres_1     |
pact_broker_1  | * Environment: production

use volumes in docker-compose to persist data
@bheemreddy181-zz
Copy link
Contributor Author

It looks like I have to update https://github.com/pact-foundation/pact-broker-docker/blob/master/script/test.sh as well for making sure docker-compose works fine

@bethesque
Copy link
Member

This looks OK to me, but it makes me concerned - are you using this docker compose file for production?

@bethesque
Copy link
Member

It's meant to be for running an easy and quick demo on a local machine, not as a long term solution for production.

@bheemreddy181-zz
Copy link
Contributor Author

that's true, demo sometime takes longer until we get the prod instance of a broker using Kubernetes we want to use the docker-compose version of the broker and to keep up to date with latest updates. so whenever we get the docker version down we want to make sure the data is persisted for the next time.

@bheemreddy181-zz
Copy link
Contributor Author

bheemreddy181-zz commented Mar 11, 2020

@bethesque if you agree, can you help me with the tests? like why they are failing?

@bethesque
Copy link
Member

bethesque commented Mar 11, 2020

You're free to use and change the docker-compose file however you like, but I don't understand why the changes you want to make for your local set up need to be applied back to the OSS code, which is not meant for production use. Can you explain the motivation there?

@bheemreddy181-zz
Copy link
Contributor Author

Well, I don't think I have to but I felt this is something good to have for everyone. My side of the story is my infrastructure team is taking some time to get the pact broker service up and running till then if want to do any upgrades by bringing down the docker service and make sure we are persisting data for next time we bring this up. ( i can do this manually by editing the docker-compose on our side alone ). if you don't think this adds any value for OSS code. you can close this off :-)

@bethesque
Copy link
Member

I can't actually see why this change would make the build fail, as the build doesn't use docker-compose. I'll try merging it and see. If it breaks master, I'll just revert it.

@bethesque bethesque merged commit 97f082b into pact-foundation:master Mar 13, 2020
@bethesque
Copy link
Member

Seems to be ok on master 🤷‍♀ Thanks. Hope you get a real one soon!

@bheemreddy181-zz bheemreddy181-zz deleted the patch-1 branch March 13, 2020 16:38
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

Successfully merging this pull request may close these issues.

None yet

3 participants