Project

General

Profile

Docker » History » Revision 66

Revision 65 (Carsten Rose, 18.04.2023 14:18) → Revision 66/111 (Carsten Rose, 18.04.2023 14:28)

h1. Docker 

 {{toc}} 

 Handout 

 | *Topic* | *Description* | 
 | GIT Repo ssh | @git@systemvcs.math.uzh.ch:it/typo3-docker.git@ | 
 | GIT Repo http | @https://systemvcs.math.uzh.ch/it/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>@ | 
 | 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@ | 



 <pre> 
 [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 

 # http: you have to specify username/password for every remote GIT action. 
 $ git clone https://systemvcs.math.uzh.ch/it/typo3-docker.git <username_instancename> 

 # ssh: username/password is given automatically, login    via ssh-agent forward: ssh -A root@webwork20 
 $ git clone git@systemvcs.math.uzh.ch:it/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 </pre> 

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

 #------------------------------------------------------- 
 # 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 ssh/authorized_keys 

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


 h1. Typo3  

 * Save personal links and ports. Best in @kpweb: webwork20/<user>@ 
 * Open mentioned T3/BE: https://webwork20:xxxx/typo3/install.php 

 !typo3_1.png! 

 !typo3_2.png! 

 * Choose "take me straight to the backend" 

 * Login > extension: add a) fluid styled content, b) typo3 edit highlighting 

 !clipboard-202303281403-ewftg.png! 

 !t3editor.png! 


 * Install latest qfq (https://qfq.io/download/?dir=releases) and uzh_cd (https://www.math.uzh.ch/repo/?dir=uzhcd/v9) 
 * Create first page: 

 !typo3_4.png! 
 !typo3_5.png! 
 !typo3_6.png! 

 * Under access, set page visible to true 
 * Add template to home (via plus): 
 !typo3_7_t1.png! 
 !typo3_7_t2.png! 
 !typo3_7_t3.png! 

 * Add page content > QFQ to home 

 !qfq_1.png! 

 <pre> 
 10.sql = SELECT "Hello world from QFQ, ", NOW() 
 </pre> 

 * Try view page on home for a first test: 
 !qfq2.png! 

 * As instructed, create a new page "Form" with pagecontent [QFQ] Form under Home and load the formEditor: 
 <pre> 
 file=_formEditor 
 </pre> 

 * Reload the page 
 !qfq3.png! 

 * Done with typo3! 

 

 h1. PhpStorm 

 * *Replace* the following ports with yours! 

 | 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 | 


 * You need the url of the page AND the xdebug port from the installation. If you do not remember them, check @/var/docker/<username>/<username_instancename>/config.json@. 
 * PhpStorm: @File > Settings > PHP > Debug@ 

 !xdebug1.png! 

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

 !xdebug2.png! 

 ** Please give a detailed name, eg. webwork20 dev, there will be multiple deployments on the same server! 
 ** Use the port for the website, not the xdebug port! 
 ** You can already map the path of extension > /var/www/html/typo3conf/ext/qfq/ 
 ** You may not see the typo3 sources: 

 !xdebug3.png! 

 ** If you see it, map typo3_src_10.4.34 to /var/www/typo3_src (see screenshot) 
 ** If not, add additional sources to your phpstorm project, then do above: 

 !xdebug4.png! 

 *** Got to File > Settings > Directories and Add new Root Directory 
 *** Add /scratch/software/typo3 
 *** Mark typo3_src_10.4.34 as Source Folder (also extension in the qfq folder, if you haven't) 
 * Finally add a new xdebug setting: 

 !xdebug5.png! 
 !xdebug6.png! 

 ** Here you can select the server you added before 
 ** Remove webwork16 if you didn't remove port 9000, to not stop webwork16 by accident. 
 * Deployment path: 
 ** Tools > Deployment > Configuration 

 !xdebug7.png! 

 !clipboard-202303281446-d1okl.png! 

 !xdebug8.png! 

 * Wenn gewuenscht kann der automatische Upload aktiviert werden: 

 !clipboard-202303281501-vsrv2.png! 

 

 h1. Tipps 

 * 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 

 !clipboard-202304081911-mfwna.png! 

 h1. Issues 

 * #15745 

 h1. PHPUnit Tests