« Modernizing the... | Main | Powered by Kubernete... »

Powered by Postgresql and Docker Swarm

It was somewhat painful but due to some problems with MySQL and Docker, and some general uneasiness with MySQL, I switched this site from MySQL v5.7 to PostgreSQL v10. I also switched over to Docker Swarm. Here's the Docker-Compose file that I'm using now to run this site:
version: '3.2'

services:

   postgresql:
      image: "postgres:10.0"
      ports:
         - "5432:5432"
      deploy:
         resources:
           limits:
              memory: 50M
      volumes:
         - type: bind
           source: /var/lib/postgresql/data
           target: /var/lib/postgresql/data
      environment:
        - POSTGRES_USER=roller
        - POSTGRES_DB=rollerdb
        - POSTGRES_PASSWORD_FILE=/run/secrets/pg_passwd
      secrets:
        - source: db_passwd
          target: pg_passwd

   roller:
      image: "rwo:latest"
      ports:
        -  "80:8080"
      depends_on:
        - postgresql
      deploy:
         resources:
           limits:
              memory: 800M
      volumes:
        - type: bind
          source: /var/lib/roller
          target: /var/lib/roller
      environment:
        - DB_HOST=postgresql
        - STORAGE_ROOT=/var/lib/roller
        - JAVA_OPTS="-Xmx700m"

secrets:
  db_passwd:
    file: ./db_passwd.txt
It was a pain, but sometimes pain = gain and I learned a lot. I'm hoping the site will be a bit more stable now.
Comments:

Any particular issue, you find with mysql ?I think postgresql consume more RAM compare to mysql.

Thanks.

Posted by Anant Jaynarayana on December 02, 2017 at 06:54 AM EST #

Anant,

No specific issue with MySQL.

I had some inexplicable problems running MySQL under Docker and switched to PostgreSQL in hopes of solving those problems. The change did not really help. I suspect there was some problem in Digital Ocean networking that was causing problems in Docker Swarm. Those problems eventually went away.

Dave

Posted by Dave Johnson on March 13, 2018 at 10:59 AM EDT #

Post a Comment:
  • HTML Syntax: NOT allowed

« Modernizing the... | Main | Powered by Kubernete... »

Welcome

This is just one entry in the weblog Blogging Roller. You may want to visit the main page of the weblog

Related entries

Below are the most recent entries in the category Roller, some may be related to this entry.