Project

General

Profile

Docker » History » Version 104

Elias Villiger, 30.11.2023 13:48

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 103 Carsten Rose
[root@webwork20] vim /var/docker/<username>/<username_instancename>/ssh/authorized_keys
69 66 Carsten Rose
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 104 Elias Villiger
h2. Clone local qfq directory
162
163
* If you have not done so already, clone the qfq directory on your local environment for development in PhpStorm
164
<pre>
165
cd  ~/PhpstormProjects
166
git clone git@git.math.uzh.ch:typo3/qfq.git
167
168
# run makefile
169
cd qfq
170
make
171
</pre>
172
* Open the project in PhpStorm
173
174 81 Carsten Rose
h2. Check Update T3 Sources in /scratch/software/typo3
175
176 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.
177 81 Carsten Rose
178
h2. Content Root
179
180 75 Carsten Rose
* Add Content Root: @File > Settings > Directories > Add Content Root: /scratch/software/typo3/typo3_src-...@
181 1 Benjamin Baer
182
!clipboard-202304181453-83ajj.png!
183 81 Carsten Rose
184
h2. Default PHP Version / Remote PHP
185
186 75 Carsten Rose
* Set a) PHP Version and b) CLI Interpreter (used as default)
187
188
!clipboard-202304191618-zomdu.png!
189
190
!clipboard-202304191619-fafjc.png!
191 1 Benjamin Baer
192 75 Carsten Rose
!clipboard-202304191620-vbtni.png!
193 72 Carsten Rose
194 81 Carsten Rose
h2. Debug
195 1 Benjamin Baer
196
* PhpStorm: @File > Settings > PHP > Debug@
197
198
!clipboard-202304181438-qmb9t.png!
199
200
* List all of the xdebug ports of your docker containers, comma separated.
201 31 Carsten Rose
* REMOVE 9000, else phpstorm will still stop webwork16.
202 1 Benjamin Baer
203 81 Carsten Rose
h2. HTTP Server
204
205
* Add Server: @File > Settings > PHP > Server > [+] @
206
207 1 Benjamin Baer
!clipboard-202304181500-ozxt9.png!
208
209 76 Carsten Rose
* Please give a detailed name, eg. webwork20 dev, there will be multiple deployments on the same server!
210 1 Benjamin Baer
* Use the *http* port for the website, not the xdebug port!
211
212 74 Carsten Rose
* Map a) the path of extension > /var/www/html/typo3conf/ext/qfq/ and b) the Typo3 Sources
213 76 Carsten Rose
214 74 Carsten Rose
!clipboard-202304191625-sbryd.png!
215 76 Carsten Rose
216 74 Carsten Rose
!clipboard-202304191629-4csfm.png!
217 78 Carsten Rose
218 81 Carsten Rose
h2. Run / Debug Configuration
219
220 1 Benjamin Baer
* Add a new @Run/Debug Configuration@ (upper right corner):
221
222
!clipboard-202304191632-rhyoj.png!
223 78 Carsten Rose
224 1 Benjamin Baer
!clipboard-202304191636-sv3pw.png!
225 79 Carsten Rose
226
* Remove webwork16 if you didn't remove port 9000, to not stop webwork16 by accident.
227 74 Carsten Rose
228 81 Carsten Rose
h2. Deployment
229 17 Benjamin Baer
230 81 Carsten Rose
* Deployment path: @Tools > Deployment > Configuration > [+] > Sftp > New Servername: ...@
231
232
!20230421-102743-842.png!
233 33 Carsten Rose
234 89 Carsten Rose
!clipboard-202304211320-eis7t.png!
235 30 Carsten Rose
236 34 Carsten Rose
* Wenn gewuenscht kann der automatische Upload aktiviert werden:
237
238
!clipboard-202303281501-vsrv2.png!
239
240 94 Carsten Rose
h1. PHPUnit Tests
241
242
* Aktuell ist noch ein Workaround noetig (Ruecksprache mit Benj) - nur damit phpunit lokal im Docker installiert ist. 
243
* Im Docker als @root@:
244
<pre>
245
$ apt install composer
246 99 Krzysztof Putyra
$ cd /var/www/html/typo3conf/ext/qfq
247 94 Carsten Rose
$ composer update
248 100 Krzysztof Putyra
$ composer dump-autoload
249 94 Carsten Rose
</pre>
250 101 Krzysztof Putyra
  The last command is required by PHPUnit to be loaded properly in the next step.
251 94 Carsten Rose
252
* PHPUnit by Remote Interpreter
253
254
!clipboard-202304211328-e4st5.png!
255
256 95 Carsten Rose
!clipboard-202304211339-hsuwe.png!
257
258 96 Zhoujie Li
!manual_nr7_phpunit.png!
259 94 Carsten Rose
260 90 Carsten Rose
h1. Issues / Probleme
261 1 Benjamin Baer
262 90 Carsten Rose
h2. Problems showing icons
263
264 50 Carsten Rose
* If the FormEditor is broken and has problems to show note.gif, the baseUrl is probably not configure in QFQ setup.
265 49 Carsten Rose
* Configure correct Site entry point
266
267
!clipboard-202304081911-mfwna.png!
268 85 Carsten Rose
269 1 Benjamin Baer
270 87 Carsten Rose
h2. Docker funktionierte nicht mehr auf webwork20
271
272
* #15745 / Docker
273 1 Benjamin Baer
274 91 Carsten Rose
h2. Class 'ComposerAutoloaderInit40...' not found
275 93 Carsten Rose
276 86 Carsten Rose
* Testweise QFQ tt-content records deaktivieren > Danach funktioniert die Seite wieder.
277
* Ursache: das @extension/composer.json@ wurde beim Deployment von Thinlinc in den Container kopiert ... das funktioniert aktuell nicht. @composer.json@  im Docker loeschen.
278 88 Carsten Rose
  !clipboard-202304211305-ig94v.png!
279
280 93 Carsten Rose
h2. Install QFQ Extension: Could not remove extension directory
281 86 Carsten Rose
282 93 Carsten Rose
* @ERROR: Could not remove extension directory "typo3conf/ext/qfq/". Reasons@
283 86 Carsten Rose
284 85 Carsten Rose
  * Fix: in docker container @chown -R www-data:www-data /var/www/html/typo3conf/ext/qfq@
285 62 Carsten Rose
286
!clipboard-202304211307-p22de.png!