docker-joomla
docker-joomla copied to clipboard
Postgresql support?
Is there any support for postgres?
At the moment no but I'd take a pull request adding build variants with PostgreSQL support.
@mbabker this has been fixed in #48.
Well, yes and no. We need to make sure our entrypoint script doesn't cause issues if you try to boot connected to a PostgreSQL container as that file does a lot of validations for MySQL stuff (the PHP dependencies are loaded now, but the runtime steps need checking).
Hey everyone! I've created gist with Docker Compose + Joomla + PostgreSQL + Nginx setup.
https://gist.github.com/stepankuzmin/6b7d206f921221f74086c162f9b6ac24
So, no plans to support PostgreSQL anytime soon?
We are looking at this, we could add the code from @stepankuzmin to the core, I have not had time to look at it yet.
So first of all thank you @stepankuzmin you configurations does indeed work, even with the latest images, and even with traefik
Here is the details I used to test this:
version: '3.7'
services:
postgress_nginx:
image: nginx:alpine
container_name: postgress_nginx
restart: unless-stopped
ports:
- 8080:80
volumes:
- "${PROJECT_PATH}/postgress/joomla:/var/www/html"
- "${PROJECT_PATH}/postgress/nginx.conf:/etc/nginx/nginx.conf"
depends_on:
- postgress_joomla
networks:
- traefik
labels:
# joomla
- "traefik.enable=true"
- "traefik.http.routers.postgress_nginx.rule=Host(`postgress.builder.vdm`)"
- "traefik.http.services.postgress_nginx.loadbalancer.server.port=80"
postgress_joomla:
image: joomla:3.10.11-php7.4-fpm-alpine
container_name: postgress_joomla
restart: unless-stopped
environment:
- JOOMLA_DB_HOST=postgress_db:5432
- JOOMLA_DB_USER=postgres
- JOOMLA_DB_PASSWORD=mysecretpassword
- JOOMLA_DB_NAME=db
volumes:
- "${PROJECT_PATH}/postgress/joomla:/var/www/html"
- "${PROJECT_PATH}/postgress/makedb.php:/makedb.php"
depends_on:
- postgress_db
networks:
- traefik
postgress_db:
image: postgres:latest
container_name: postgress_db
restart: unless-stopped
environment:
- POSTGRES_DB=db
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=mysecretpassword
volumes:
- "${PROJECT_PATH}/postgress/db:/var/lib/postgresql/data"
networks:
- traefik
networks:
traefik:
external:
name: traefik_webgateway
So we can make some changes to accommodate the postgress implementation.
Hey guys!
Any plans when the official container will support PostgreSQL out of the box?
I did not get around to working on this last year. Except for the official release stuff I have taken a few weeks "break" from all community support. I will make this a high priority soon as I am back, which will be beginning March the soonest.
Okay seems like I have a workable solution here, can anyone test this please? We want to achieve to objectives here, one the mysql should still work as before without any change needed. Then of course the PostgreSQL should also now work with an extra tag JOOMLA_DB_TYPE=pgsql
Checkout the pgsql branch and let me know if there is any issues.
Once I have confirmation of stability we can proceed to merge. @HLeithner can you also give this a look.
Please give your testing feedback to this PR.
Changes has been merged and will become available when we release Joomla 4.3.1
Thank you very much for adding official PostgreSQL support to Joomla Docker images.
I had a problem connecting to my external PostgreSQL database and had to fix makedb.php to add " dbname={$db}" to the connection string :
elseif ($dbType === 'pgsql')
{
$port = $port ? (int)$port : 5432;
$maxTries = 10;
do {
$connection = "host={$host} port={$port} dbname={$db} user={$user} password={$password}";
$dbconn = @pg_connect($connection);
Am I the only one to have had this problem because without the fix, I would get "PostgreSQL Connection Error" ?