Skip to content

chore(docker): add postgresql service properly#108

Draft
xmnlab wants to merge 1 commit into
thegraphnetwork:mainfrom
xmnlab:add-pg-docker-on-production
Draft

chore(docker): add postgresql service properly#108
xmnlab wants to merge 1 commit into
thegraphnetwork:mainfrom
xmnlab:add-pg-docker-on-production

Conversation

@xmnlab

@xmnlab xmnlab commented May 25, 2022

Copy link
Copy Markdown
Member

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

xmnlab commented May 25, 2022

Copy link
Copy Markdown
Member Author

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

@fccoelho

Copy link
Copy Markdown
Contributor

Sounds good to me

@fccoelho

Copy link
Copy Markdown
Contributor

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

@xmnlab

xmnlab commented May 31, 2022

Copy link
Copy Markdown
Member Author

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

xmnlab commented Jun 9, 2022

Copy link
Copy Markdown
Member Author

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
Copy Markdown
Contributor

@xmnlab is this PR still alive?

@xmnlab

xmnlab commented Oct 29, 2022

Copy link
Copy Markdown
Member Author

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