Project

General

Profile

Docker » History » Version 87

Carsten Rose, 21.04.2023 13:12

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