Project

General

Profile

Docker » History » Version 107

Elias Villiger, 01.12.2023 13:05

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