tematres/TemaTres-Vocabulary-Server

Docker compatibility

Closed this issue · 9 comments

It will be cool and easiest if the application run at docker containers.

We are going to use TemaTres for our app, for managing taxanomies of our software.
As all our envirnonment is dockerized, it will be our way to go. Previous link doesn't provide a Dockerfile or docker-compose file so it's not good for us. It also uses previous version so I guess it's better two use version 3, isn't it?

We can make our dockerfile afterwards available to all users, however I have two questions:

  • php version
  • mysql version

I guess mysql version 5.7 is ok. php version in your wiki doc says something about v4 or 5. Should we use php 5.6 (currently not supported) or, even go for version 7.3?

Thank you!

Hi @juanda99 :) I'm very happy about your initiative to put TemaTres in Docker. We test in production Tematres in PHP Version 7.0.33 and MySql mysql 5.7 (mysql 5.7.25).
If you want we can test Tematres on PHP 7.3
Please let me know about any problem or doubt :)

best regards!

T1loc commented

Hello,

One thing would be amazing will be to fetch some configuration from environment variables and the db password from secrets/or environment variables.

For my usage I use this dockerfile :

# This Dockerfile uses the latest version of the Bitnami PHP-FPM Docker image
FROM php:7.4-apache

# Copy app's source code to the /app directory
COPY app-code /var/www/html

RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"

RUN docker-php-source extract && \
    docker-php-ext-install mysqli \
    && docker-php-source delete

I do not need a mysql inside since I use an external service for that.

You can also use the image with kubernetes :

---
apiVersion: v1
kind: Pod
metadata:
  name: tematres
  labels:
    app: tematres
spec:
  containers:
  - name: tematres
    image: tematresImageBuiltPreviously
    ports:
    - containerPort: 80

---
apiVersion: v1
kind: Service
metadata:
  name: tematres
spec:
  selector:
    app: tematres
  ports:
  - port: 80
    targetPort: 80

---
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
  annotations:
    kubernetes.io/ingress.class: "nginx"
  name: tematres
spec:
  rules:
  - host: url.of.tematres
    http:
      paths:
      - backend:
          serviceName: tematres
          servicePort: 80

Some other things:

  • I need to use German collation, so we use by default the latin1 and latin1_general_ci collation.
    It would be awesome if we can use config/env variables when we install tematres.
    Right now I changed the vocab/install.php to match with my need.
  • The default mysql engine use should be a parameter also -> MyISAM is hardcoded into vocab/install.php.
    InnoDB should be the default standard I think :-)
  • And a last one -> Under vocabulary config -> "URI" should be optional. Hardcoding the url into the database do not allow us to be flexible.

Edit:

  • I created a configmap where I store the content of db.tematres.php then I'm able to dynamically replace data with my helm chart.

Hi @T1loc :) thank you about the feedback and in special about the las 3 recomendations :). We go to:

  1. add config option to set collation
  2. adopt InnoDB and add config option about this

About URI: Tematres can manage many instances with the same core, so we use the URI of each vocab to manage differentiate sessions. You can change the URI in config form. Another solution can be use relative URL in navigation.

About Dokeos... I do not have experience with dokeos... please help me to help :) I know case about tematres fork who add tiny script to create tematres instances (http://vocabularios.educacion.gov.ar/admin/)

Best regards :)

T1loc commented

Hello @tematres

Thank you, for 2 points.

About docker :

  • The easy way will be to create a README who explain how to deploy tematres with apache2 / php7 and mysql.

If it's enough for @regisnew and @juanda99 I can provide you the PR.

T1loc commented

@tematres But it will be nice to have the #53 if we want to be able to use multiple replicas on docker :-)

Please check the new commit, we add support in db.tematres.php for InnoDB and charset configuration :). Thank you!

T1loc commented

it looks good ! thank you.