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

chore(docker): add postgresql service properly #108

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

xmnlab
Copy link
Member

@xmnlab xmnlab commented May 25, 2022

This PR aims to add a production service for postgresql.

Changes:

  • Update docker service for prostgresql in order to have it ready for production
  • uses named volume for the postgresql data
  • add scripts for restoring and dump

it resolves #105

Assumptions:

  • In order to avoid any problems with the current postgresql server, it would be better to have a solution that would be easily switchable.
  • using docker bind mount approach, it maybe could corrupt the current postgresql data folder on host in the setup (if something goes wrong)
  • using docker bind mount approach, the backup would be easier
  • using named volume approach, it is easy to switch to a cloud storage, or copy the entire volume to other containers, etc
  • we can use the same strategy for staging and production and keep the production data safe
  • bind mount, example: - /var/lib/postgresql/data/pgdata:/var/lib/postgresql/data/pgdata
  • named volume, example: - pgdata:/var/lib/postgresql/data/pgdata

@xmnlab
Copy link
Member Author

xmnlab commented May 25, 2022

@fccoelho after some investigation I decided to pick the named volume approach.

@fccoelho
Copy link
Contributor

Sounds good to me

@fccoelho
Copy link
Contributor

We need to validate this well in the staging server, so that we don't risk interruption of our service.

@xmnlab
Copy link
Member Author

xmnlab commented May 31, 2022

We need to validate this well in the staging server, so that we don't risk interruption of our service.

sure thing! :)

@fccoelho I will move this forward this week.

@xmnlab xmnlab force-pushed the add-pg-docker-on-production branch from 2b8ff57 to 76b2261 Compare June 8, 2022 16:17
@xmnlab
Copy link
Member Author

xmnlab commented Jun 9, 2022

I will add a few more things tomorrow, and I will start to play that on the staging server

@xmnlab xmnlab force-pushed the add-pg-docker-on-production branch from 5a33897 to a8439c0 Compare June 13, 2022 20:44
@fccoelho
Copy link
Contributor

@xmnlab is this PR still alive?

@xmnlab
Copy link
Member Author

xmnlab commented Oct 29, 2022

I need to rebase and finish that. Also, we will need something for the backup

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.

Move host postgresql server to docker container
2 participants