ep3-bs icon indicating copy to clipboard operation
ep3-bs copied to clipboard

ep3 vorgefertigt als Docker Container

Open MaAr389 opened this issue 1 year ago • 2 comments

Hallo,

gibt es das ep3-System auch als Docker-Container? Viele Ansätze die ich online gefunden habe, sind leider nicht funktionsfähig.

Anpassung an der Dockerfile haben nichts gebracht, ob nun PHP Version größer, gleich 8.1. Composer File und Update im Zend wünscht sich statt 8.1, dann doch lieber 5.6 und 7.0.

Gibt es dort einen verfolgbaren Ansatz?

Vielen Dank im Voraus!

MaAr389 avatar Apr 28 '23 10:04 MaAr389

Ich nutze folgende docker-compose.yml um das Buchungssystem laufen zu lassen:

version: "3"
services:
  nginx:
    image: nginx:alpine
    ports:
      - 8080:80
    volumes:
      - ./data/web/:/var/www/html
      - ./config/nginx/:/etc/nginx/conf.d/
      - ./logs/nginx/:/var/logs/nginx/
  php:
    build: ./php
    volumes:
      - ./data/web/:/var/www/html/
      - ./logs/php.log:/var/log/php-fpm.www.log
  db:
    image: mariadb
    environment:
      MARIADB_ROOT_PASSWORD: GehtDichNichtsAn
      MARIADB_PASSWORD: ep3bs
      MARIADB_DATABASE: ep3bs
      MARIADB_USER: ep3bs
    ports:
      - 3307:3306
    volumes:
      - ./config/mariadb:/etc/mysql
      - ./data/mariadb/:/var/lib/mysql

Folgende Ordnerstruktur ist darin vorhanden:

docker-compose.yml
config/
- mariadb/
- nginx/
  - default.conf
data/
- mariadb/...
- web/...
logs/
- nginx/
- php.log/
php/
- Dockerfile

Du legst dann einfach alle entpackten Dateien des Downloads von ep3bs in den data/web-Ordner.

Die default.conf für nginx sieht so aus:

server {
    listen 0.0.0.0:80;
    root /var/www/html/public;
    index index.php index.html;
    
    location / {
        try_files $uri $uri/ /index.php$is_args$args;
    }
    
    location /setup.php {
        try_files $uri $uri/ /setup.php$is_args$args;
    }
    
    location ~ \.php$ {
        include fastcgi_params;
        fastcgi_pass php:9000;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
    }
}

Die php-Dockerfile sieht wie folgt aus:

FROM php:8.1-fpm-alpine

RUN apk update && apk add icu-dev
RUN docker-php-ext-install intl pdo_mysql
RUN docker-php-ext-enable intl pdo_mysql

Die Datei unter web/config/autoload/local.php hat dann folgende Datenbankkonfiguration:

    'db' => array(
        'database' => 'ep3bs',
        'username' => 'ep3bs',
        'password' => 'ep3bs',

        'hostname' => 'db',
        'port' => 3306,
    ),

Du kannst die entsprechenden Umgebungsvariablen in der docker-compose.yml natürlich auch selber anpassen. Beachte dann nur, diese auch entsprechend in der Konfiguration richtig zu setzen.

MarcTroll avatar May 08 '23 12:05 MarcTroll

Tried using this. But the setup doesn't seem to want to populate the tables. The tables are created, but the options table rows remains empty, and eventually the request times out.

I was able to manually execute the db create script, but then the setup errors out.

I read a comment somewhere about nginx being the culprit. Apache needed perhaps for the initial setup?

stalsma-palmetto avatar Feb 07 '24 13:02 stalsma-palmetto