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

PostgreSQL Container for Docker Cluster #42

Merged
merged 7 commits into from
Sep 8, 2021

Conversation

bodo-hugo-barwich
Copy link
Contributor

This introduces support for PostgreSQL for the Docker Cluster.
As discussed in #26

It's important to mention that the DBD::Pg Perl Module required PostgreSQL development libraries on the Web Service container which are only available for the PostgresSQL Version 11
The databases of Version 10 and 11 are incompatible so the version of the PostgreSQL container is 11.13
According to the End of Life Policy at Postgres this seems to be a reasonable versioning:
Postgres Versioning Chart

@bodo-hugo-barwich
Copy link
Contributor Author

The access from the Web Service container is documented as correct
according to the Mojolicious documentation:
https://docs.mojolicious.org/Mojo/Pg#SYNOPSIS

per1_web@b2046f460754:~$ perl -I ~/perl5/lib/perl5/ perldoc-browser.pl index all
pg 0 dmp:
bless({
  dsn => "dbi:Pg:dbname=perldoc;host=db",
  options => {
    AutoCommit          => 1,
    AutoInactiveDestroy => 1,
    PrintError          => 0,
    PrintWarn           => 0,
    RaiseError          => 1,
  },
  password => "secret",
  username => "perldoc",
}, "Mojo::Pg")
pg version: 'PostgreSQL 11.13 on x86_64-pc-linux-musl, compiled by gcc (Alpine 10.3.1_git20210424) 10.3.1 20210424, 64-bit'

also in the PostgreSQL container the entries can be found correctly:

$ docker-compose exec db /bin/sh
/ $ psql -h db -U perldoc perldoc
Password for user perldoc: 
psql (11.13)
Type "help" for help.

perldoc=# \dt
             List of relations
 Schema |      Name       | Type  |  Owner  
--------+-----------------+-------+---------
 public | faqs            | table | perldoc
 public | functions       | table | perldoc
 public | mojo_migrations | table | perldoc
 public | perldeltas      | table | perldoc
 public | pods            | table | perldoc
 public | variables       | table | perldoc
(6 rows)

perldoc=# select count(*) from pods;
 count 
-------
  1456
(1 row)

.gitignore Outdated Show resolved Hide resolved
@bodo-hugo-barwich
Copy link
Contributor Author

to resolve the permission conflict at image build time I added the .dockerignore
as documented at
Conflict about persistent Database Storage Location

@Grinnz Grinnz merged commit b7a8298 into Grinnz:master Sep 8, 2021
@Grinnz
Copy link
Owner

Grinnz commented Sep 8, 2021

Thanks again!

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.

2 participants