Project

General

Profile

Docker » History » Version 100

Krzysztof Putyra, 07.11.2023 17:09

1 97 Carsten Rose
git@git.math.uzh.ch:typo3/typo3-docker.gith1. Docker
2 15 Benjamin Baer
3 29 Carsten Rose
{{toc}}
4 28 Carsten Rose
5 26 Carsten Rose
Handout
6
7 38 Carsten Rose
| *Topic* | *Description* |
8 97 Carsten Rose
| GIT Repo ssh | @git@git.math.uzh.ch:typo3/typo3-docker.git@ |
9
| GIT Repo http | @https://git.math.uzh.ch/typo3/typo3-docker.git@ |
10 93 Carsten Rose
| Docker Host | @webwork20@ - alle Befehle werden als @root@ ausgefuehrt |
11 51 Carsten Rose
| Docker Verzeichnis | @/var/docker/<username>@ |
12 74 Carsten Rose
| Konfiguration / Ports | @/var/docker/<username>/<username_instancename>/config.json@ |
13 64 Carsten Rose
| Save in kpdev | @Root > webwork20 > webwork20/crose_qfq [docker]@ |
14 51 Carsten Rose
| T3 FE, xdebug, PMA | @https://webwork20.math.uzh.ch:<port>@ |
15
| Start Docker | @docker compose up -d@ |
16
| Stop Docker | @docker compose down@ |
17 26 Carsten Rose
| *Update Docker Image* | @docker compose down; git pull; docker compose build; docker compose up -d@ |
18
19 1 Benjamin Baer
<pre>
20 21 Carsten Rose
[root@webwork20]
21
22
$ cd /var/docker/
23 40 Carsten Rose
$ mkdir <username>
24 1 Benjamin Baer
$ cd /var/docker/<username>
25
26 58 Carsten Rose
# Checkout git repo - decide to if you like to use 'http' or 'ssh'. 
27 1 Benjamin Baer
# You can change later, check: https://wiki.math.uzh.ch/public/Git#Change_Repo:_http_.3E_ssh
28 98 Carsten Rose
$ git clone https://git.math.uzh.ch/typo3/typo3-docker.git
29 58 Carsten Rose
30
# ssh: username/password is given automatically, login  via ssh-agent forward: ssh -A root@webwork20
31 97 Carsten Rose
$ git clone git@git.math.uzh.ch:typo3/typo3-docker.git <username_instancename>
32 58 Carsten Rose
33
# Main Branch ist Typo3 V10
34 37 Carsten Rose
35 39 Carsten Rose
# In case T3 V11 should be used
36 21 Carsten Rose
$ git checkout typo11
37
38 40 Carsten Rose
$ cd /var/docker/<username>/<username_instancename>
39 21 Carsten Rose
40 66 Carsten Rose
# Create docker images and prepare nginx, mariadb, pma
41 21 Carsten Rose
# execute bootstrap.py
42
$ python3 bootstrap.py
43 66 Carsten Rose
....
44
⠿ Network crose1_dev_default      Created                                                                                               0.1s
45
⠿ Container crose1_dev-mariadb-1  Healthy                                                                                              16.5s
46
⠿ Container crose1_dev-pma-1      Started                                                                                              17.0s
47
⠿ Container crose1_dev-nginx-1    Started                                                                                              17.2s
48
First time install: http://webwork20:51515/typo3/install.php
49
web: http://webwork20:51515
50
pma: http://webwork20:52195
51
xdebug: 53859
52
ssh: ssh root@webwork20 -p 58785
53
54
#-------------------------------------------------------
55
# Create a keepass entry in @kpdev@ under webwork20, incl. your instance password, with the above mentioned ports!
56
#-------------------------------------------------------
57
58
#-------------------------------------------------------
59
# Configure ssh passwordless access to the nginx/php docker.
60
# If not already done before, create a personal private/public SSH keys (in thinlinc): ssh-keygen -t ed25519
61
#-------------------------------------------------------
62
63
# Transfer the public SSH key from Thinlinc to the docker on webwork20.
64
[user@tlx] cat ~/.ssh/id_ed25519.pub
65
ssh-ed25519 AAA... 
66
67
# Copy/paste the key on webwork20
68
[root@webwork20] vim ssh/authorized_keys
69
70 1 Benjamin Baer
# Test the password less login ... accept the new SSH hostkey.
71 66 Carsten Rose
[user@tlx] ssh root@webwork20 -p 58785
72 64 Carsten Rose
</pre>
73
74 74 Carsten Rose
h1. Typo3
75 22 Carsten Rose
76 81 Carsten Rose
h2. Setup
77
78 67 Carsten Rose
* Open T3/BE: https://webwork20:xxxx/typo3/install.php
79 22 Carsten Rose
80 1 Benjamin Baer
!typo3_1.png!
81 22 Carsten Rose
82 1 Benjamin Baer
!typo3_2.png!
83 22 Carsten Rose
84
* Choose "take me straight to the backend"
85 1 Benjamin Baer
86 84 Carsten Rose
h2. Extensions: Fluid, T3 BE Highlight, QFQ, UZH_CD
87 1 Benjamin Baer
88 81 Carsten Rose
* Login > extension:
89
** *fluid styled content*
90
** *typo3 edit highlighting*
91
** *qfq* -  https://qfq.io/download/?dir=releases  
92
** *uzh_cd* - https://www.math.uzh.ch/repo/?dir=uzhcd/v9  
93
94 63 Carsten Rose
!clipboard-202303281403-ewftg.png!
95
96 1 Benjamin Baer
!t3editor.png!
97
98 82 Carsten Rose
h2. QFQ Extension Config
99
100
* Set baseUrl
101
102
!clipboard-202304211259-9zi62.png!
103
104 81 Carsten Rose
h2. Test Page 
105
106 15 Benjamin Baer
* Create first page:
107 24 Carsten Rose
108 1 Benjamin Baer
!typo3_4.png!
109 15 Benjamin Baer
!typo3_5.png!
110
!typo3_6.png!
111 24 Carsten Rose
112 15 Benjamin Baer
* Under access, set page visible to true
113 1 Benjamin Baer
* Add template to home (via plus):
114 15 Benjamin Baer
!typo3_7_t1.png!
115 1 Benjamin Baer
!typo3_7_t2.png!
116
!typo3_7_t3.png!
117
118 81 Carsten Rose
h2. Test Content
119
120 16 Benjamin Baer
* Add page content > QFQ to home
121
122 74 Carsten Rose
!https://project.math.uzh.ch/projects/qfq/wiki/Docker/qfq_1.png!
123 16 Benjamin Baer
124 1 Benjamin Baer
<pre>
125 16 Benjamin Baer
10.sql = SELECT "Hello world from QFQ, ", NOW()
126
</pre>
127
128
* Try view page on home for a first test:
129
!qfq2.png!
130
131
* As instructed, create a new page "Form" with pagecontent [QFQ] Form under Home and load the formEditor:
132 74 Carsten Rose
133 16 Benjamin Baer
<pre>
134
file=_formEditor
135 18 Enis Nuredini
</pre>
136
137
* Reload the page
138 1 Benjamin Baer
!qfq3.png!
139
140 81 Carsten Rose
h2. T3 Version
141
142 71 Carsten Rose
* Get and remember the T3 version (for source directory in PhpStorm)
143
144
!clipboard-202304181445-ecvvz.png!
145 1 Benjamin Baer
146 17 Benjamin Baer
* Done with typo3!
147
148 1 Benjamin Baer
h1. PhpStorm
149
150 81 Carsten Rose
h2. TCP Ports
151
152 65 Carsten Rose
* *Replace* the following ports with yours!
153 69 Carsten Rose
154 65 Carsten Rose
| Config File | @/var/docker/<username>/<username_instancename>/config.json@ |
155
| First time install | http://webwork20:51515/typo3/install.php |
156
| web | http://webwork20:51515 |
157 72 Carsten Rose
| pma | http://webwork20:52195 |
158 1 Benjamin Baer
| xdebug | 53859 |
159
| ssh | ssh root@webwork20 -p 58785 |
160
161 81 Carsten Rose
h2. Check Update T3 Sources in /scratch/software/typo3
162
163 1 Benjamin Baer
* 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.
164 81 Carsten Rose
165
h2. Content Root
166
167 75 Carsten Rose
* Add Content Root: @File > Settings > Directories > Add Content Root: /scratch/software/typo3/typo3_src-...@
168 1 Benjamin Baer
169
!clipboard-202304181453-83ajj.png!
170 81 Carsten Rose
171
h2. Default PHP Version / Remote PHP
172
173 75 Carsten Rose
* Set a) PHP Version and b) CLI Interpreter (used as default)
174
175
!clipboard-202304191618-zomdu.png!
176
177
!clipboard-202304191619-fafjc.png!
178 1 Benjamin Baer
179 75 Carsten Rose
!clipboard-202304191620-vbtni.png!
180 72 Carsten Rose
181 81 Carsten Rose
h2. Debug
182 1 Benjamin Baer
183
* PhpStorm: @File > Settings > PHP > Debug@
184
185
!clipboard-202304181438-qmb9t.png!
186
187
* List all of the xdebug ports of your docker containers, comma separated.
188 31 Carsten Rose
* REMOVE 9000, else phpstorm will still stop webwork16.
189 1 Benjamin Baer
190 81 Carsten Rose
h2. HTTP Server
191
192
* Add Server: @File > Settings > PHP > Server > [+] @
193
194 1 Benjamin Baer
!clipboard-202304181500-ozxt9.png!
195
196 76 Carsten Rose
* Please give a detailed name, eg. webwork20 dev, there will be multiple deployments on the same server!
197 1 Benjamin Baer
* Use the *http* port for the website, not the xdebug port!
198
199 74 Carsten Rose
* Map a) the path of extension > /var/www/html/typo3conf/ext/qfq/ and b) the Typo3 Sources
200 76 Carsten Rose
201 74 Carsten Rose
!clipboard-202304191625-sbryd.png!
202 76 Carsten Rose
203 74 Carsten Rose
!clipboard-202304191629-4csfm.png!
204 78 Carsten Rose
205 81 Carsten Rose
h2. Run / Debug Configuration
206
207 1 Benjamin Baer
* Add a new @Run/Debug Configuration@ (upper right corner):
208
209
!clipboard-202304191632-rhyoj.png!
210 78 Carsten Rose
211 1 Benjamin Baer
!clipboard-202304191636-sv3pw.png!
212 79 Carsten Rose
213
* Remove webwork16 if you didn't remove port 9000, to not stop webwork16 by accident.
214 74 Carsten Rose
215 81 Carsten Rose
h2. Deployment
216 17 Benjamin Baer
217 81 Carsten Rose
* Deployment path: @Tools > Deployment > Configuration > [+] > Sftp > New Servername: ...@
218
219
!20230421-102743-842.png!
220 33 Carsten Rose
221 89 Carsten Rose
!clipboard-202304211320-eis7t.png!
222 30 Carsten Rose
223 34 Carsten Rose
* Wenn gewuenscht kann der automatische Upload aktiviert werden:
224
225
!clipboard-202303281501-vsrv2.png!
226
227 94 Carsten Rose
h1. PHPUnit Tests
228
229
* Aktuell ist noch ein Workaround noetig (Ruecksprache mit Benj) - nur damit phpunit lokal im Docker installiert ist. 
230
* Im Docker als @root@:
231
<pre>
232
$ apt install composer
233 99 Krzysztof Putyra
$ cd /var/www/html/typo3conf/ext/qfq
234 94 Carsten Rose
$ composer update
235 100 Krzysztof Putyra
$ composer dump-autoload
236 94 Carsten Rose
</pre>
237 100 Krzysztof Putyra
The last command is required for PHPUnit to be loaded properly in the next step.
238 94 Carsten Rose
239
* PHPUnit by Remote Interpreter
240
241
!clipboard-202304211328-e4st5.png!
242
243 95 Carsten Rose
!clipboard-202304211339-hsuwe.png!
244
245 96 Zhoujie Li
!manual_nr7_phpunit.png!
246 94 Carsten Rose
247 90 Carsten Rose
h1. Issues / Probleme
248 1 Benjamin Baer
249 90 Carsten Rose
h2. Problems showing icons
250
251 50 Carsten Rose
* If the FormEditor is broken and has problems to show note.gif, the baseUrl is probably not configure in QFQ setup.
252 49 Carsten Rose
* Configure correct Site entry point
253
254
!clipboard-202304081911-mfwna.png!
255 85 Carsten Rose
256 1 Benjamin Baer
257 87 Carsten Rose
h2. Docker funktionierte nicht mehr auf webwork20
258
259
* #15745 / Docker
260 1 Benjamin Baer
261 91 Carsten Rose
h2. Class 'ComposerAutoloaderInit40...' not found
262 93 Carsten Rose
263 86 Carsten Rose
* Testweise QFQ tt-content records deaktivieren > Danach funktioniert die Seite wieder.
264
* Ursache: das @extension/composer.json@ wurde beim Deployment von Thinlinc in den Container kopiert ... das funktioniert aktuell nicht. @composer.json@  im Docker loeschen.
265 88 Carsten Rose
  !clipboard-202304211305-ig94v.png!
266
267 93 Carsten Rose
h2. Install QFQ Extension: Could not remove extension directory
268 86 Carsten Rose
269 93 Carsten Rose
* @ERROR: Could not remove extension directory "typo3conf/ext/qfq/". Reasons@
270 86 Carsten Rose
271 85 Carsten Rose
  * Fix: in docker container @chown -R www-data:www-data /var/www/html/typo3conf/ext/qfq@
272 62 Carsten Rose
273
!clipboard-202304211307-p22de.png!