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