Project

General

Profile

Actions

Docker

Handout

Topic Description
GIT Repo ssh git@git.math.uzh.ch:typo3/typo3-docker.git
GIT Repo http https://git.math.uzh.ch/typo3/typo3-docker.git
Docker Host webwork20 - alle Befehle werden als root ausgefuehrt
Docker Verzeichnis /var/docker/<username>
Konfiguration / Ports /var/docker/<username>/<username_instancename>/config.json
Save in kpdev Root > webwork20 > webwork20/crose_qfq [docker]
T3 FE, xdebug, PMA https://webwork20.math.uzh.ch:<port>
PMA Server / Username Server: db, Username: root
Start Docker docker compose up -d
Stop Docker docker compose down
Update Docker Image docker compose down; git pull; docker compose build; docker compose up -d
[root@webwork20]

$ cd /var/docker/
$ mkdir <username>
$ cd /var/docker/<username>

# Checkout git repo - decide to if you like to use 'http' or 'ssh'. 
# You can change later, check: https://wiki.math.uzh.ch/public/Git#Change_Repo:_http_.3E_ssh
$ git clone https://git.math.uzh.ch/typo3/typo3-docker.git

# ssh: username/password is given automatically, login  via ssh-agent forward: ssh -A root@webwork20
$ git clone git@git.math.uzh.ch:typo3/typo3-docker.git <username_instancename>

# Main Branch ist Typo3 V10

# In case T3 V11 should be used
$ git checkout typo11

$ cd /var/docker/<username>/<username_instancename>

# Create docker images and prepare nginx, mariadb, pma
# execute bootstrap.py
$ python3 bootstrap.py
....
⠿ Network crose1_dev_default      Created                                                                                               0.1s
⠿ Container crose1_dev-mariadb-1  Healthy                                                                                              16.5s
⠿ Container crose1_dev-pma-1      Started                                                                                              17.0s
⠿ Container crose1_dev-nginx-1    Started                                                                                              17.2s
First time install: http://webwork20:51515/typo3/install.php
web: http://webwork20:51515
pma: http://webwork20:52195
xdebug: 53859
ssh: ssh root@webwork20 -p 58785

#-------------------------------------------------------
# Create a keepass entry in @kpdev@ under webwork20, incl. your instance password, with the above mentioned ports!
#-------------------------------------------------------

#-------------------------------------------------------
# Configure ssh passwordless access to the nginx/php docker.
# If not already done before, create a personal private/public SSH keys (in thinlinc): ssh-keygen -t ed25519
#-------------------------------------------------------

# Transfer the public SSH key from Thinlinc to the docker on webwork20.
[user@tlx] cat ~/.ssh/id_ed25519.pub
ssh-ed25519 AAA... 

# Copy/paste the key on webwork20
[root@webwork20] vim /var/docker/<username>/<username_instancename>/ssh/authorized_keys

# Test the password less login ... accept the new SSH hostkey.
[user@tlx] ssh root@webwork20 -p 58785

Typo3

Setup

  • Choose "take me straight to the backend"

Extensions: Fluid, T3 BE Highlight, QFQ, UZH_CD

QFQ Extension Config

  • Set baseUrl

Test Page 

  • Create first page:



  • Under access, set page visible to true
  • Add template to home (via plus):


Test Content

  • Add page content > QFQ to home

10.sql = SELECT "Hello world from QFQ, ", NOW()
  • Try view page on home for a first test:
  • As instructed, create a new page "Form" with pagecontent [QFQ] Form under Home and load the formEditor:
file=_formEditor
  • Reload the page

T3 Version

  • Get and remember the T3 version (for source directory in PhpStorm)

  • Done with typo3!

PhpStorm

TCP Ports

  • Replace the following ports with yours!
Config File /var/docker/<username>/<username_instancename>/config.json
First time install http://webwork20:51515/typo3/install.php
web http://webwork20:51515
pma http://webwork20:52195
xdebug 53859
ssh ssh root@webwork20 -p 58785

Clone local qfq directory

  • If you have not done so already, clone the qfq directory on your local environment for development in PhpStorm
    cd  ~/PhpstormProjects
    git clone git@git.math.uzh.ch:typo3/qfq.git
    
    # run makefile
    cd qfq
    make
    npm run build
    
  • Open the project in PhpStorm

Check Update T3 Sources in /scratch/software/typo3

  • Typo3: during docker bootstrap, the latest Typo3 V10 version will be downloaded - if that one is not already uploaded to /scratch/software/typo3, do this first.

Content Root

  • Add Content Root: File > Settings > Directories > Add Content Root: /scratch/software/typo3/typo3_src-...

Default PHP Version / Remote PHP

  • Set a) PHP Version and b) CLI Interpreter (used as default)

Debug

  • PhpStorm: File > Settings > PHP > Debug

  • List all of the xdebug ports of your docker containers, comma separated.
  • REMOVE 9000, else phpstorm will still stop webwork16.

HTTP Server

  • Add Server: File > Settings > PHP > Server > [+] 

  • Please give a detailed name, eg. webwork20 dev, there will be multiple deployments on the same server!
  • Use the http port for the website, not the xdebug port!
  • Map a) the path of extension > /var/www/html/typo3conf/ext/qfq/ and b) the Typo3 Sources

Run / Debug Configuration

  • Add a new Run/Debug Configuration (upper right corner or Run > Edit Configurations ...):

  • Remove webwork16 if you didn't remove port 9000, to not stop webwork16 by accident.

Deployment

  • Deployment path: Tools > Deployment > Configuration > [+] > Sftp > New Servername: ...

  • Wenn gewuenscht kann der automatische Upload aktiviert werden:

PHPUnit Tests

  • Aktuell ist noch ein Workaround noetig (Ruecksprache mit Benj) - nur damit phpunit lokal im Docker installiert ist.
  • Im Docker als root:
    $ apt install composer
    $ cd /var/www/html/typo3conf/ext/qfq
    $ composer update
    $ composer dump-autoload
    

    The last command is required by PHPUnit to be loaded properly in the next step.
  • PHPUnit by Remote Interpreter

Issues / Probleme

Problems showing icons

  • If the FormEditor is broken and has problems to show note.gif, the baseUrl is probably not configure in QFQ setup.
  • Configure correct Site entry point

Docker funktionierte nicht mehr auf webwork20

  • #15745 / Docker

Class 'ComposerAutoloaderInit40...' not found

  • Testweise QFQ tt-content records deaktivieren > Danach funktioniert die Seite wieder.
  • Ursache: das extension/composer.json wurde beim Deployment von Thinlinc in den Container kopiert ... das funktioniert aktuell nicht. composer.json im Docker loeschen.

Install QFQ Extension: Could not remove extension directory

  • ERROR: Could not remove extension directory "typo3conf/ext/qfq/". Reasons
    • Fix: in docker container chown -R www-data:www-data /var/www/html/typo3conf/ext/qfq

Updated by Elias Villiger 3 months ago · 110 revisions