Docker Container

If you've programmed a new HuMo-genealogy feature (that you'd like to see included in the official version), please upload and describe your work here.
JonTheNiceGuy
Posts: 9
Joined: Thu 09 Jan 2020, 14:24

Re: Docker Container

Post by JonTheNiceGuy »

Hmm yes, I see what you mean. I'll have a fiddle.

I hadn't looked into pictures, as the database my father supplied didn't include pictures, and I didn't think about persisting the GEDCOM files or about the CMS...

Perhaps we need a separate mount statement for where the pictures and GEDCOM files are stored?
User avatar
Huub
HuMo-genealogy programmer
HuMo-genealogy programmer
Posts: 2693
Joined: Wed 27 Aug 2008, 11:34
Location: Heerhugowaard, Netherlands
Contact:

Re: Docker Container

Post by Huub »

I have tried this, not working yet (also named the containers, because it's easier to see which containers are used for HuMo-genealogy):

Code: Select all

  nginx:
    build:
      context: ..
      dockerfile: Docker/nginx/Dockerfile
    container_name:
      nginx_humo
    restart: always
    volumes:
      - .gedcom_files:/var/www/html/admin/gedcom_files
      - .media:/var/www/html/media
    ports:
      - 0.0.0.0:1980:80
:arrow: HuMo-genealogy update? Backup your database! Editing in HuMo-genealogy? Backup your data!
Make multiple backups with: PHPMyAdmin, gedcom export and database export.

HuMo-genealogy software: http://humo-gen.com
User avatar
Huub
HuMo-genealogy programmer
HuMo-genealogy programmer
Posts: 2693
Joined: Wed 27 Aug 2008, 11:34
Location: Heerhugowaard, Netherlands
Contact:

Re: Docker Container

Post by Huub »

Hi Jon,

Because of your remark:
I've been bundling up the application as a docker container for a few years, and I'd love to contribute some knowledge to the development team - perhaps looking at some sort of pipeline to automatically release new images?
I tried to connect Github to Sourceforge. This time it was succesful! A new release at Github is now connected to Sourceforge :D

Thanks for the Docker scripts! I really like this improvement for HuMo-genealogy.
The Docker files are included version 6.0.2. I will try to improve them (extra volumes for media and GEDCOM files, and adjust settings so it's possible to upload large GEDCOM files).
Maybe I have some problems with owner/ permission settings of the new volumes. I allready tried adjusting them manually, but it's not successful yet. Will be tested in the next weeks.
:arrow: HuMo-genealogy update? Backup your database! Editing in HuMo-genealogy? Backup your data!
Make multiple backups with: PHPMyAdmin, gedcom export and database export.

HuMo-genealogy software: http://humo-gen.com
JonTheNiceGuy
Posts: 9
Joined: Thu 09 Jan 2020, 14:24

Re: Docker Container

Post by JonTheNiceGuy »

Another tool which might help if you get to the point where a container is being published is this Github Actions script: https://git.mclarkdev.com/BarcodeAPI.or ... ublish.yml
User avatar
Huub
HuMo-genealogy programmer
HuMo-genealogy programmer
Posts: 2693
Joined: Wed 27 Aug 2008, 11:34
Location: Heerhugowaard, Netherlands
Contact:

Re: Docker Container

Post by Huub »

I'm still trying to add an media volume. For some reason it doesn't work, but I don't give up, will try more in next weeks...
:arrow: HuMo-genealogy update? Backup your database! Editing in HuMo-genealogy? Backup your data!
Make multiple backups with: PHPMyAdmin, gedcom export and database export.

HuMo-genealogy software: http://humo-gen.com
LukEG
Posts: 5
Joined: Sat 24 Dec 2022, 19:10

Re: Docker Container

Post by LukEG »

Huub wrote: Tue 20 Dec 2022, 22:15 I'm still trying to add an media volume. For some reason it doesn't work, but I don't give up, will try more in next weeks...
Hi!
Were you able to deal with the issue?
How can I help?
Is it possible now to get the latest version docker image for humogen?
User avatar
Huub
HuMo-genealogy programmer
HuMo-genealogy programmer
Posts: 2693
Joined: Wed 27 Aug 2008, 11:34
Location: Heerhugowaard, Netherlands
Contact:

Re: Docker Container

Post by Huub »

Hi LukEG,

Welcome at the forum!

The Docker files are added in the most recent version: 6.0.2. It 's possible to use that version to add HuMo-genealogy in Docker.
I'm still learning (I started using Docker about a year ago), it's something like this:

1) Copy HuMo-genealogy 6.0.2. to Docker PC (Raspberry Pi or something like that).
2) Go to HuMo-genealogy folder: Docker
3) Use command: docker-compose up -d

If changes are made in 1 of the HuMo-genealogy Docker files, use command: docker-compose up -d --build

I had to use the full URL (including index.php) to open admin screen: http://192.168.x.x:1980/admin/index.php
Database connection:
host: mariadb
Other database fields: humo-gen

It does work! But:
- GEDCOM files will be lost if Docker is restarted.
- Media files can't be connected yet.

I did several tests in HuMo-genealogy Docker/docker-compose.yml (not succesful yet, see part "volumes"):

Code: Select all

version: '3'

#volumes:
#  gedcom_files:
#    driver: local
#    driver_opts:
#      type: 'none'
#      o: 'bind'
#      device: '/var/www/html/admin/gedcom_files'

services:
  #db:
  #  image: mysql:latest
  #  volumes:
  #    - ./mysql:/var/lib/mysql
  #  restart: always
  #  expose:
  #    - 3306
  #  env_file:
  #    - .env
  #  environment:
  #    MYSQL_RANDOM_ROOT_PASSWORD: "true"

  mariadb:
    image: linuxserver/mariadb:latest
    container_name:
      mariadb_humo
    restart: always
    volumes:
      - .mysql:/config/databases
    #env_file:
    #  - .env
    environment:
      MYSQL_RANDOM_ROOT_PASSWORD: "yes"
      TZ: Europe/Amsterdam
      MYSQL_DATABASE: humo-gen
      MYSQL_USER: humo-gen
      MYSQL_PASSWORD: humo-gen
      PUID: 1000
      PGID: 1000
    ports:
      - 3306:3306

  nginx:
    build:
      context: ..
      dockerfile: Docker/nginx/Dockerfile
    container_name:
      nginx_humo
    restart: always
    #user: root
    volumes:
      #- ./humo:/var/www/html
      #- ./gedcom_files:/var/www/html/admin/gedcom_files
      #- ./media:/var/www/html/media
      #- .gedcom_files:/var/www/html/admin/gedcom_files
      #- .media:/var/www/html/media
    #environment:
    #  PUID: 1000
    #  PGID: 1000
    ports:
      - 0.0.0.0:1980:80

  fpm:
    build:
      context: ..
      dockerfile: Docker/fpm/Dockerfile
    container_name:
      fpm_humo
    restart: always
    env_file:
      - .env
    environment:
      MYSQL_HOST: db

  # Can be used to login database
  #phpmyadmin:
  #  #image: phpmyadmin/phpmyadmin:latest
  #  image: arm32v7/phpmyadmin
  #  container_name:
  #    phpmyadmin_humo
  #  restart:
  #    always
  #  ports:
  #    - 8000:80
  #  environment:
  #    - PMA_ARBITRARY=1
:arrow: HuMo-genealogy update? Backup your database! Editing in HuMo-genealogy? Backup your data!
Make multiple backups with: PHPMyAdmin, gedcom export and database export.

HuMo-genealogy software: http://humo-gen.com
LukEG
Posts: 5
Joined: Sat 24 Dec 2022, 19:10

Re: Docker Container

Post by LukEG »

Huub wrote: Sun 25 Dec 2022, 10:22
1) Copy HuMo-genealogy 6.0.2. to Docker PC (Raspberry Pi or something like that).
2) Go to HuMo-genealogy folder: Docker
3) Use command: docker-compose up -d
Why don't you try to set an official image on hub.docker.com?
That would be easier than always create image from dockerfile.
User avatar
Huub
HuMo-genealogy programmer
HuMo-genealogy programmer
Posts: 2693
Joined: Wed 27 Aug 2008, 11:34
Location: Heerhugowaard, Netherlands
Contact:

Re: Docker Container

Post by Huub »

Because the Docker file isn't finished yet. Only basic functionality is working.
I don't like to publish a partly finished Docker file.

There are a few problems to be solved:
- Media files can't be connected yet. So it's not possible to show pictures.
- Large GEDCOM files can't be read (probably a server setting for size of file). And probably time settings must be changed.
- GEDCOM files will be lost if Docker is restarted.
- Upload of media files isn't possible (fault message).
- Selection of media files isn't possible.
- Database backup fails.

I haven't tested all pages, maybe there are more problems to be solved.

I will do some more tests installing HuMo-genealogy in Docker in the next weeks. But it probably will take some time to solve all issues.
:arrow: HuMo-genealogy update? Backup your database! Editing in HuMo-genealogy? Backup your data!
Make multiple backups with: PHPMyAdmin, gedcom export and database export.

HuMo-genealogy software: http://humo-gen.com
User avatar
Huub
HuMo-genealogy programmer
HuMo-genealogy programmer
Posts: 2693
Joined: Wed 27 Aug 2008, 11:34
Location: Heerhugowaard, Netherlands
Contact:

Re: Docker Container

Post by Huub »

I solved the large GEDCOM upload problem, added in nginx/Dockerfile:

Code: Select all

    echo '  client_max_body_size 100M;' >> /etc/nginx/conf.d/default.conf ; \
Also solved errors for pictures, changed fpm/Dockerfile (but at this moment pictures will be lost if Docker is restarted):

Code: Select all

FROM php:fpm
RUN apt-get update -y && apt-get install -y libwebp-dev libjpeg62-turbo-dev libpng-dev libxpm-dev \
    libfreetype6-dev
RUN apt-get update && \
    apt-get install -y \
        zlib1g-dev
RUN docker-php-ext-install pdo pdo_mysql
RUN docker-php-ext-configure gd --with-freetype=/usr/include/ --with-jpeg=/usr/include/
RUN docker-php-ext-install -j$(nproc) gd
# content
ADD --chown=www-data:www-data ./ /var/www/html
At this moment I couldn't solve the volume problem. So using images and storing GEDCOM files isn't possible at this moment. Also using the backup system doesn't work yet.

Other problem: I created a hub.docker account, but I don't know how to add the docker-compose file into a container or image. It's a bit complex. I allready tried to generate an image using: docker-compose build and docker buildx bake. But it doesn't work. I allready read several websites to solve the problem, but at the moment I just don't know what commands are needed to build the image to use in hub.docker.
For now it's only possible to use the Docker files by installing manually in Docker.
:arrow: HuMo-genealogy update? Backup your database! Editing in HuMo-genealogy? Backup your data!
Make multiple backups with: PHPMyAdmin, gedcom export and database export.

HuMo-genealogy software: http://humo-gen.com
Post Reply