Project

General

Profile

Docker » History » Version 81

Carsten Rose, 21.04.2023 10:28

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 81 Carsten Rose
h2. Extensions
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 81 Carsten Rose
h2. Test Page 
101
102 15 Benjamin Baer
* Create first page:
103 24 Carsten Rose
104 1 Benjamin Baer
!typo3_4.png!
105 15 Benjamin Baer
!typo3_5.png!
106
!typo3_6.png!
107 24 Carsten Rose
108 15 Benjamin Baer
* Under access, set page visible to true
109 1 Benjamin Baer
* Add template to home (via plus):
110 15 Benjamin Baer
!typo3_7_t1.png!
111 1 Benjamin Baer
!typo3_7_t2.png!
112
!typo3_7_t3.png!
113
114 81 Carsten Rose
h2. Test Content
115
116 16 Benjamin Baer
* Add page content > QFQ to home
117
118 74 Carsten Rose
!https://project.math.uzh.ch/projects/qfq/wiki/Docker/qfq_1.png!
119 16 Benjamin Baer
120 1 Benjamin Baer
<pre>
121 16 Benjamin Baer
10.sql = SELECT "Hello world from QFQ, ", NOW()
122
</pre>
123
124
* Try view page on home for a first test:
125
!qfq2.png!
126
127
* As instructed, create a new page "Form" with pagecontent [QFQ] Form under Home and load the formEditor:
128 74 Carsten Rose
129 16 Benjamin Baer
<pre>
130
file=_formEditor
131 18 Enis Nuredini
</pre>
132
133
* Reload the page
134 1 Benjamin Baer
!qfq3.png!
135
136 81 Carsten Rose
h2. T3 Version
137
138 71 Carsten Rose
* Get and remember the T3 version (for source directory in PhpStorm)
139
140
!clipboard-202304181445-ecvvz.png!
141 1 Benjamin Baer
142 17 Benjamin Baer
* Done with typo3!
143
144 1 Benjamin Baer
h1. PhpStorm
145
146 81 Carsten Rose
h2. TCP Ports
147
148 65 Carsten Rose
* *Replace* the following ports with yours!
149 69 Carsten Rose
150 65 Carsten Rose
| Config File | @/var/docker/<username>/<username_instancename>/config.json@ |
151
| First time install | http://webwork20:51515/typo3/install.php |
152
| web | http://webwork20:51515 |
153 72 Carsten Rose
| pma | http://webwork20:52195 |
154 1 Benjamin Baer
| xdebug | 53859 |
155
| ssh | ssh root@webwork20 -p 58785 |
156
157 81 Carsten Rose
h2. Check Update T3 Sources in /scratch/software/typo3
158
159 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.
160 81 Carsten Rose
161
h2. Content Root
162
163 75 Carsten Rose
* Add Content Root: @File > Settings > Directories > Add Content Root: /scratch/software/typo3/typo3_src-...@
164 1 Benjamin Baer
165
!clipboard-202304181453-83ajj.png!
166 81 Carsten Rose
167
h2. Default PHP Version / Remote PHP
168
169 75 Carsten Rose
* Set a) PHP Version and b) CLI Interpreter (used as default)
170
171
!clipboard-202304191618-zomdu.png!
172
173
!clipboard-202304191619-fafjc.png!
174 1 Benjamin Baer
175 75 Carsten Rose
!clipboard-202304191620-vbtni.png!
176 72 Carsten Rose
177 81 Carsten Rose
h2. Debug
178 1 Benjamin Baer
179
* PhpStorm: @File > Settings > PHP > Debug@
180
181
!clipboard-202304181438-qmb9t.png!
182
183
* List all of the xdebug ports of your docker containers, comma separated.
184 31 Carsten Rose
* REMOVE 9000, else phpstorm will still stop webwork16.
185 1 Benjamin Baer
186 81 Carsten Rose
h2. HTTP Server
187
188
* Add Server: @File > Settings > PHP > Server > [+] @
189
190 1 Benjamin Baer
!clipboard-202304181500-ozxt9.png!
191
192 76 Carsten Rose
* Please give a detailed name, eg. webwork20 dev, there will be multiple deployments on the same server!
193 1 Benjamin Baer
* Use the *http* port for the website, not the xdebug port!
194
195 74 Carsten Rose
* Map a) the path of extension > /var/www/html/typo3conf/ext/qfq/ and b) the Typo3 Sources
196 76 Carsten Rose
197 74 Carsten Rose
!clipboard-202304191625-sbryd.png!
198 76 Carsten Rose
199 74 Carsten Rose
!clipboard-202304191629-4csfm.png!
200 78 Carsten Rose
201 81 Carsten Rose
h2. Run / Debug Configuration
202
203 1 Benjamin Baer
* Add a new @Run/Debug Configuration@ (upper right corner):
204
205
!clipboard-202304191632-rhyoj.png!
206 78 Carsten Rose
207 1 Benjamin Baer
!clipboard-202304191636-sv3pw.png!
208 79 Carsten Rose
209
* Remove webwork16 if you didn't remove port 9000, to not stop webwork16 by accident.
210 74 Carsten Rose
211 81 Carsten Rose
h2. Deployment
212 17 Benjamin Baer
213 81 Carsten Rose
* Deployment path: @Tools > Deployment > Configuration > [+] > Sftp > New Servername: ...@
214
215
!20230421-102743-842.png!
216 33 Carsten Rose
217
!clipboard-202303281446-d1okl.png!
218
219 19 Benjamin Baer
!xdebug8.png!
220 30 Carsten Rose
221 34 Carsten Rose
* Wenn gewuenscht kann der automatische Upload aktiviert werden:
222
223
!clipboard-202303281501-vsrv2.png!
224
225 49 Carsten Rose
h1. Tipps
226
227 50 Carsten Rose
* If the FormEditor is broken and has problems to show note.gif, the baseUrl is probably not configure in QFQ setup.
228 49 Carsten Rose
* Configure correct Site entry point
229
230
!clipboard-202304081911-mfwna.png!
231
232 1 Benjamin Baer
h1. Issues
233
234 36 Carsten Rose
* #15745
235 62 Carsten Rose
236
h1. PHPUnit Tests