Project

General

Profile

Docker » History » Version 111

Carsten Rose, 29.04.2024 12:19

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