@fishawack/lab-env 1.18.1 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/README.md +297 -0
- package/cli.js +4 -0
- package/commands/create/libs/vars.js +4 -0
- package/commands/wp.js +15 -0
- package/core/{0.0.20 → 0.0.21}/Dockerfile +1 -1
- package/core/{0.0.20 → 0.0.21}/entrypoint.sh +0 -0
- package/core/docker-compose.yml +1 -0
- package/core/package.json +2 -2
- package/craftcms/3/docker-compose.yml +5 -1
- package/craftcms/3/php/Dockerfile +2 -5
- package/craftcms/3/php/policy.xml +99 -0
- package/drupal/9/docker-compose.yml +5 -1
- package/drupal/9/php/Dockerfile +0 -6
- package/globals.js +10 -1
- package/intercept.sh +5 -0
- package/laravel/8/docker-compose.yml +5 -1
- package/laravel/8/php/Dockerfile +2 -8
- package/package.json +1 -1
- package/wordpress/5.7.2/docker-compose.yml +22 -10
- package/wordpress/5.7.2/wordpress/Dockerfile +16 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
## Changelog
|
|
2
2
|
|
|
3
|
+
### 2.0.2 (2022-04-26)
|
|
4
|
+
* [Change] Bumped core `0.0.20` to `0.0.21`
|
|
5
|
+
* [Bug] Lock eb-cli due to breaking change
|
|
6
|
+
* [Bug] Removed imagemagick from php containers as it's now included in base image
|
|
7
|
+
* [Misc] Updated core publish postversion command
|
|
8
|
+
|
|
9
|
+
### 2.0.1 (2022-04-13)
|
|
10
|
+
* [Bug] Explicitly set platform to fix M1 chip issues
|
|
11
|
+
|
|
12
|
+
### 2.0.0 (2022-04-05)
|
|
13
|
+
* [Feature] Craftcms now an option in `fw new` command
|
|
14
|
+
* [Change] Wordpress repos now works differently and will flag unsupported unless they change their folder structure - see [migration guide](https://demo.fishawack.solutions/Lab/Doc/#lab-env-migrating-200)
|
|
15
|
+
* [Docs] Wordpress migration guide
|
|
16
|
+
|
|
3
17
|
### 1.18.1 (2022-03-30)
|
|
4
18
|
* [Bug] Craftcms now correctly calls reinstall and deploy commands
|
|
5
19
|
|
package/README.md
CHANGED
|
@@ -195,3 +195,300 @@ Or you can target specific node_modules and hand pick which ones to remove. For
|
|
|
195
195
|
```bash
|
|
196
196
|
docker volume rm boilerplate_node_modules
|
|
197
197
|
```
|
|
198
|
+
|
|
199
|
+
## Migrating
|
|
200
|
+
|
|
201
|
+
### 2.0.0
|
|
202
|
+
|
|
203
|
+
Wordpress repo's are now structured slightly differently to better match laravel, drupal and craftcms setups. Follow these steps to upgrade a wordpress build and get lab-env working again.
|
|
204
|
+
|
|
205
|
+
#### Reset repository
|
|
206
|
+
|
|
207
|
+
Before starting this migration ensure all code is committed so you don't run the risk of losing anything afterwhich run one of the following.
|
|
208
|
+
|
|
209
|
+
```bash
|
|
210
|
+
fw nuke
|
|
211
|
+
|
|
212
|
+
# or
|
|
213
|
+
|
|
214
|
+
Remove / Re-clone repository
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
#### wp-content
|
|
218
|
+
|
|
219
|
+
Move the plugins, themes and uploads folder a new wp-content folder at the root of the project.
|
|
220
|
+
|
|
221
|
+
```bash
|
|
222
|
+
# Old way
|
|
223
|
+
./themes
|
|
224
|
+
./plugins
|
|
225
|
+
./uploads
|
|
226
|
+
|
|
227
|
+
# New way
|
|
228
|
+
./wp-content/themes
|
|
229
|
+
./wp-content/plugins
|
|
230
|
+
./wp-content/uploads
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
#### .env.example
|
|
234
|
+
|
|
235
|
+
Replace the contents of the .env.example with the following.
|
|
236
|
+
|
|
237
|
+
```bash
|
|
238
|
+
# Old way
|
|
239
|
+
DB_DATABASE=wordpress
|
|
240
|
+
DB_USERNAME=wordpress
|
|
241
|
+
DB_PASSWORD=password
|
|
242
|
+
JWT_SECRET=
|
|
243
|
+
|
|
244
|
+
# New way
|
|
245
|
+
DEBUG=true
|
|
246
|
+
|
|
247
|
+
DB_DATABASE=wordpress
|
|
248
|
+
DB_USERNAME=wordpress
|
|
249
|
+
DB_PASSWORD=password
|
|
250
|
+
DB_HOST=mysql
|
|
251
|
+
DB_CHARSET=utf8
|
|
252
|
+
DB_COLLATE=
|
|
253
|
+
|
|
254
|
+
TABLE_PREFIX=wp_
|
|
255
|
+
|
|
256
|
+
AUTH_KEY=5c94a709b751faeed445f29b92f8513b8bce1652
|
|
257
|
+
SECURE_AUTH=09e370e7bfc34b17fc96d80cda1a281427053afd
|
|
258
|
+
LOGGED_IN=405de7e577398c86b6975fc4a8bba1df179666dd
|
|
259
|
+
NONCE_KEY=10c232cb86bb257af4c0434a7e3b9f993f18ba11
|
|
260
|
+
AUTH_SALT=07a08cb5a6c3318633c505fcf1ffffa4d01ab375
|
|
261
|
+
SECURE_AUTH=df11e32128f8d5403a7c681d0e5cc4145be2b2ab
|
|
262
|
+
LOGGED_IN=a99860e8150b15e11caada875f56421165659a7d
|
|
263
|
+
NONCE_SALT=51c6eba59477027e612fc13e38a53acaa2b73d92
|
|
264
|
+
|
|
265
|
+
CONFIG_EXTRA="
|
|
266
|
+
define( 'WP_HOME', 'http://localhost:3000' );
|
|
267
|
+
define( 'WP_SITEURL', 'http://localhost:3000' );
|
|
268
|
+
"
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
#### .gitignore
|
|
272
|
+
|
|
273
|
+
There's a new more complex gitignore now that takes into account the wordpress files that are reverse mounted back to the host machine.
|
|
274
|
+
|
|
275
|
+
```bash
|
|
276
|
+
# Old way
|
|
277
|
+
# These are some examples of commonly ignored file patterns.
|
|
278
|
+
# You should customize this list as applicable to your project.
|
|
279
|
+
# Learn more about .gitignore:
|
|
280
|
+
# https://www.atlassian.com/git/tutorials/saving-changes/gitignore
|
|
281
|
+
|
|
282
|
+
# Node artifact files
|
|
283
|
+
node_modules/
|
|
284
|
+
dist/
|
|
285
|
+
|
|
286
|
+
# Compiled Java class files
|
|
287
|
+
*.class
|
|
288
|
+
|
|
289
|
+
# Compiled Python bytecode
|
|
290
|
+
*.py[cod]
|
|
291
|
+
|
|
292
|
+
# Log files
|
|
293
|
+
*.log
|
|
294
|
+
|
|
295
|
+
# Package files
|
|
296
|
+
*.jar
|
|
297
|
+
|
|
298
|
+
# Maven
|
|
299
|
+
target/
|
|
300
|
+
dist/
|
|
301
|
+
|
|
302
|
+
# JetBrains IDE
|
|
303
|
+
.idea/
|
|
304
|
+
|
|
305
|
+
# Unit test reports
|
|
306
|
+
TEST*.xml
|
|
307
|
+
|
|
308
|
+
# Generated by MacOS
|
|
309
|
+
.DS_Store
|
|
310
|
+
|
|
311
|
+
# Generated by Windows
|
|
312
|
+
Thumbs.db
|
|
313
|
+
|
|
314
|
+
# Applications
|
|
315
|
+
*.app
|
|
316
|
+
*.exe
|
|
317
|
+
*.war
|
|
318
|
+
|
|
319
|
+
# Large media files
|
|
320
|
+
*.mp4
|
|
321
|
+
*.tiff
|
|
322
|
+
*.avi
|
|
323
|
+
*.flv
|
|
324
|
+
*.mov
|
|
325
|
+
*.wmv
|
|
326
|
+
.env
|
|
327
|
+
|
|
328
|
+
|
|
329
|
+
.tmp/
|
|
330
|
+
generated/
|
|
331
|
+
_Zips/
|
|
332
|
+
_Pdfs/
|
|
333
|
+
coverage/
|
|
334
|
+
**/generated/**/*
|
|
335
|
+
_Build/**/pulled/**/*
|
|
336
|
+
_Output
|
|
337
|
+
_Login
|
|
338
|
+
_Packages
|
|
339
|
+
_Build/content
|
|
340
|
+
_Build/media/content
|
|
341
|
+
_App
|
|
342
|
+
_Electron
|
|
343
|
+
_Node/stats
|
|
344
|
+
ssh-*
|
|
345
|
+
.ftppass
|
|
346
|
+
id_rsa
|
|
347
|
+
misc.json
|
|
348
|
+
.cache/
|
|
349
|
+
themes/twenty*
|
|
350
|
+
themes/thirty*
|
|
351
|
+
themes/*/css
|
|
352
|
+
themes/*/js
|
|
353
|
+
plugins/akismet
|
|
354
|
+
plugins/hello.php
|
|
355
|
+
uploads
|
|
356
|
+
|
|
357
|
+
# New way
|
|
358
|
+
# These are some examples of commonly ignored file patterns.
|
|
359
|
+
# You should customize this list as applicable to your project.
|
|
360
|
+
# Learn more about .gitignore:
|
|
361
|
+
# https://www.atlassian.com/git/tutorials/saving-changes/gitignore
|
|
362
|
+
|
|
363
|
+
# Node artifact files
|
|
364
|
+
node_modules/
|
|
365
|
+
dist/
|
|
366
|
+
|
|
367
|
+
# Compiled Java class files
|
|
368
|
+
*.class
|
|
369
|
+
|
|
370
|
+
# Compiled Python bytecode
|
|
371
|
+
*.py[cod]
|
|
372
|
+
|
|
373
|
+
# Log files
|
|
374
|
+
*.log
|
|
375
|
+
|
|
376
|
+
# Package files
|
|
377
|
+
*.jar
|
|
378
|
+
|
|
379
|
+
# Maven
|
|
380
|
+
target/
|
|
381
|
+
dist/
|
|
382
|
+
|
|
383
|
+
# JetBrains IDE
|
|
384
|
+
.idea/
|
|
385
|
+
|
|
386
|
+
# Unit test reports
|
|
387
|
+
TEST*.xml
|
|
388
|
+
|
|
389
|
+
# Generated by Windows
|
|
390
|
+
Thumbs.db
|
|
391
|
+
|
|
392
|
+
# Applications
|
|
393
|
+
*.app
|
|
394
|
+
*.exe
|
|
395
|
+
*.war
|
|
396
|
+
|
|
397
|
+
# Large media files
|
|
398
|
+
*.mp4
|
|
399
|
+
*.tiff
|
|
400
|
+
*.avi
|
|
401
|
+
*.flv
|
|
402
|
+
*.mov
|
|
403
|
+
*.wmv
|
|
404
|
+
.env
|
|
405
|
+
|
|
406
|
+
.tmp/
|
|
407
|
+
generated/
|
|
408
|
+
_Zips/
|
|
409
|
+
_Pdfs/
|
|
410
|
+
coverage/
|
|
411
|
+
**/generated/**/*
|
|
412
|
+
_Build/**/pulled/**/*
|
|
413
|
+
_Output
|
|
414
|
+
_Login
|
|
415
|
+
_Packages
|
|
416
|
+
_Build/content
|
|
417
|
+
_Build/media/content
|
|
418
|
+
_App
|
|
419
|
+
_Electron
|
|
420
|
+
_Node/stats
|
|
421
|
+
ssh-*
|
|
422
|
+
.ftppass
|
|
423
|
+
id_rsa
|
|
424
|
+
misc.json
|
|
425
|
+
.cache/
|
|
426
|
+
|
|
427
|
+
# Wordpress docker image files
|
|
428
|
+
.htaccess
|
|
429
|
+
license.txt
|
|
430
|
+
readme.html
|
|
431
|
+
index.php
|
|
432
|
+
xmlrpc.php
|
|
433
|
+
wp-*
|
|
434
|
+
!wp-content**/*
|
|
435
|
+
wp-content/index.php
|
|
436
|
+
wp-content/plugins/index.php
|
|
437
|
+
wp-content/themes/index.php
|
|
438
|
+
wp-content/themes/twenty*
|
|
439
|
+
wp-content/themes/thirty*
|
|
440
|
+
wp-content/themes/fishawack/css
|
|
441
|
+
wp-content/themes/fishawack/js
|
|
442
|
+
wp-content/plugins/akismet
|
|
443
|
+
wp-content/plugins/hello.php
|
|
444
|
+
wp-content/uploads
|
|
445
|
+
|
|
446
|
+
# Generated by MacOS
|
|
447
|
+
.DS_Store
|
|
448
|
+
```
|
|
449
|
+
|
|
450
|
+
#### Default theme location
|
|
451
|
+
|
|
452
|
+
The default root attribute needs updating to take into account the new folder structure.
|
|
453
|
+
|
|
454
|
+
```json
|
|
455
|
+
// Old way
|
|
456
|
+
"attributes": {
|
|
457
|
+
"root": "themes/fishawack",
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
// New way
|
|
461
|
+
"attributes": {
|
|
462
|
+
"root": "wp-content/themes/fishawack",
|
|
463
|
+
}
|
|
464
|
+
```
|
|
465
|
+
|
|
466
|
+
#### Deploy files
|
|
467
|
+
|
|
468
|
+
The deploy paths also need updating to take into account the new folder structure.
|
|
469
|
+
|
|
470
|
+
```json
|
|
471
|
+
// Old way
|
|
472
|
+
"paths": [
|
|
473
|
+
{
|
|
474
|
+
"src": "plugins",
|
|
475
|
+
"dest": "wp-content/plugins"
|
|
476
|
+
},
|
|
477
|
+
{
|
|
478
|
+
"src": "themes",
|
|
479
|
+
"dest": "wp-content/themes"
|
|
480
|
+
}
|
|
481
|
+
]
|
|
482
|
+
|
|
483
|
+
// New way
|
|
484
|
+
"paths": [
|
|
485
|
+
{
|
|
486
|
+
"src": "wp-content/plugins",
|
|
487
|
+
"dest": "wp-content/plugins"
|
|
488
|
+
},
|
|
489
|
+
{
|
|
490
|
+
"src": "wp-content/themes",
|
|
491
|
+
"dest": "wp-content/themes"
|
|
492
|
+
}
|
|
493
|
+
]
|
|
494
|
+
```
|
package/cli.js
CHANGED
|
@@ -45,6 +45,10 @@ if(!_.services && !(args[0] === 'origin' || args[0] === '--version')) return;
|
|
|
45
45
|
commands.push('drush');
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
+
if(_.platform === "wordpress"){
|
|
49
|
+
commands.push('wp');
|
|
50
|
+
}
|
|
51
|
+
|
|
48
52
|
if(_.platform === "laravel" || _.platform === "drupal" || _.platform === "craftcms"){
|
|
49
53
|
commands.push('composer', 'php');
|
|
50
54
|
}
|
package/commands/wp.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const _ = require('../globals.js');
|
|
2
|
+
|
|
3
|
+
const execSync = require('child_process').execSync;
|
|
4
|
+
|
|
5
|
+
module.exports = [
|
|
6
|
+
['wp [command...]', 'wordpress'],
|
|
7
|
+
'run wp-cli command',
|
|
8
|
+
yargs => {
|
|
9
|
+
yargs.positional('command', {
|
|
10
|
+
describe: 'command to run',
|
|
11
|
+
default: ''
|
|
12
|
+
});
|
|
13
|
+
},
|
|
14
|
+
argv => _.up(() => execSync(`${_.docker} ${_.exec} wordpress bash -lc "wp ${argv.command.join(' ')} --allow-root"`, _.opts))
|
|
15
|
+
];
|
|
@@ -132,7 +132,7 @@ RUN apt-get install -y locales
|
|
|
132
132
|
# Install AWS Elastic Beanstalk cli
|
|
133
133
|
RUN apt-get install -y zlib1g-dev libssl-dev libncurses-dev libffi-dev libsqlite3-dev libreadline-dev libbz2-dev
|
|
134
134
|
|
|
135
|
-
RUN git clone https://github.com/aws/aws-elastic-beanstalk-cli-setup.git
|
|
135
|
+
RUN git clone https://github.com/aws/aws-elastic-beanstalk-cli-setup.git --depth 1 --branch v0.1.2
|
|
136
136
|
RUN ./aws-elastic-beanstalk-cli-setup/scripts/bundled_installer
|
|
137
137
|
RUN rm -rf ./aws-elastic-beanstalk-cli-setup
|
|
138
138
|
|
|
File without changes
|
package/core/docker-compose.yml
CHANGED
package/core/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "core",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.21",
|
|
4
4
|
"description": "lab-env docker config for the @fishawack/core npm module",
|
|
5
5
|
"scripts": {
|
|
6
|
-
"postversion": "docker
|
|
6
|
+
"postversion": "mv ./*/ ./$npm_package_version && docker build ./*/ -t fishawack/core:$npm_package_version -t fishawack/core:latest && docker push fishawack/core:$npm_package_version && docker push fishawack/core:latest && git add . && git commit -m 'Bumped core to $npm_package_version'"
|
|
7
7
|
},
|
|
8
8
|
"author": "Mike Mellor",
|
|
9
9
|
"license": "ISC"
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
services:
|
|
2
2
|
mysql:
|
|
3
|
+
platform: linux/amd64
|
|
3
4
|
image: mysql:5.7
|
|
4
5
|
networks:
|
|
5
6
|
- default
|
|
@@ -13,6 +14,7 @@ services:
|
|
|
13
14
|
volumes:
|
|
14
15
|
- mysql:/var/lib/mysql
|
|
15
16
|
nginx:
|
|
17
|
+
platform: linux/amd64
|
|
16
18
|
image: nginx:1.19
|
|
17
19
|
networks:
|
|
18
20
|
- default
|
|
@@ -22,10 +24,11 @@ services:
|
|
|
22
24
|
ports:
|
|
23
25
|
- "${PORT_WEB:-8000}:80"
|
|
24
26
|
php:
|
|
27
|
+
platform: linux/amd64
|
|
25
28
|
build:
|
|
26
29
|
context: ./php/
|
|
27
30
|
dockerfile: Dockerfile
|
|
28
|
-
image: lab-env/craftcms/3/php:0.0.
|
|
31
|
+
image: lab-env/craftcms/3/php:0.0.2
|
|
29
32
|
init: true
|
|
30
33
|
working_dir: /app
|
|
31
34
|
networks:
|
|
@@ -33,6 +36,7 @@ services:
|
|
|
33
36
|
volumes:
|
|
34
37
|
- $CWD/:/app
|
|
35
38
|
- ./php/custom.conf:/opt/bitnami/php/etc/custom.conf
|
|
39
|
+
- ./php/policy.xml:/etc/ImageMagick-6/policy.xml
|
|
36
40
|
- vendor:/app/vendor
|
|
37
41
|
networks:
|
|
38
42
|
default:
|
|
@@ -6,11 +6,8 @@ MAINTAINER Mike Mellor
|
|
|
6
6
|
RUN apt-get update && \
|
|
7
7
|
apt-get install -y mariadb-client
|
|
8
8
|
|
|
9
|
-
# Install
|
|
10
|
-
RUN apt-get install -y
|
|
11
|
-
|
|
12
|
-
# PHP Imagick ext
|
|
13
|
-
RUN pecl install imagick && docker-php-ext-enable imagick
|
|
9
|
+
# Install ghostscript
|
|
10
|
+
RUN apt-get install -y ghostscript
|
|
14
11
|
|
|
15
12
|
# Cleanup apt-get install folders
|
|
16
13
|
RUN apt-get clean && \
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<!DOCTYPE policymap [
|
|
3
|
+
<!ELEMENT policymap (policy)*>
|
|
4
|
+
<!ATTLIST policymap xmlns CDATA #FIXED ''>
|
|
5
|
+
<!ELEMENT policy EMPTY>
|
|
6
|
+
<!ATTLIST policy xmlns CDATA #FIXED '' domain NMTOKEN #REQUIRED
|
|
7
|
+
name NMTOKEN #IMPLIED pattern CDATA #IMPLIED rights NMTOKEN #IMPLIED
|
|
8
|
+
stealth NMTOKEN #IMPLIED value CDATA #IMPLIED>
|
|
9
|
+
]>
|
|
10
|
+
<!--
|
|
11
|
+
Configure ImageMagick policies.
|
|
12
|
+
|
|
13
|
+
Domains include system, delegate, coder, filter, path, or resource.
|
|
14
|
+
|
|
15
|
+
Rights include none, read, write, execute and all. Use | to combine them,
|
|
16
|
+
for example: "read | write" to permit read from, or write to, a path.
|
|
17
|
+
|
|
18
|
+
Use a glob expression as a pattern.
|
|
19
|
+
|
|
20
|
+
Suppose we do not want users to process MPEG video images:
|
|
21
|
+
|
|
22
|
+
<policy domain="delegate" rights="none" pattern="mpeg:decode" />
|
|
23
|
+
|
|
24
|
+
Here we do not want users reading images from HTTP:
|
|
25
|
+
|
|
26
|
+
<policy domain="coder" rights="none" pattern="HTTP" />
|
|
27
|
+
|
|
28
|
+
The /repository file system is restricted to read only. We use a glob
|
|
29
|
+
expression to match all paths that start with /repository:
|
|
30
|
+
|
|
31
|
+
<policy domain="path" rights="read" pattern="/repository/*" />
|
|
32
|
+
|
|
33
|
+
Lets prevent users from executing any image filters:
|
|
34
|
+
|
|
35
|
+
<policy domain="filter" rights="none" pattern="*" />
|
|
36
|
+
|
|
37
|
+
Any large image is cached to disk rather than memory:
|
|
38
|
+
|
|
39
|
+
<policy domain="resource" name="area" value="1GP"/>
|
|
40
|
+
|
|
41
|
+
Use the default system font unless overwridden by the application:
|
|
42
|
+
|
|
43
|
+
<policy domain="system" name="font" value="/usr/share/fonts/favorite.ttf"/>
|
|
44
|
+
|
|
45
|
+
Define arguments for the memory, map, area, width, height and disk resources
|
|
46
|
+
with SI prefixes (.e.g 100MB). In addition, resource policies are maximums
|
|
47
|
+
for each instance of ImageMagick (e.g. policy memory limit 1GB, -limit 2GB
|
|
48
|
+
exceeds policy maximum so memory limit is 1GB).
|
|
49
|
+
|
|
50
|
+
Rules are processed in order. Here we want to restrict ImageMagick to only
|
|
51
|
+
read or write a small subset of proven web-safe image types:
|
|
52
|
+
|
|
53
|
+
<policy domain="delegate" rights="none" pattern="*" />
|
|
54
|
+
<policy domain="filter" rights="none" pattern="*" />
|
|
55
|
+
<policy domain="coder" rights="none" pattern="*" />
|
|
56
|
+
<policy domain="coder" rights="read|write" pattern="{GIF,JPEG,PNG,WEBP}" />
|
|
57
|
+
-->
|
|
58
|
+
<policymap>
|
|
59
|
+
<!-- <policy domain="resource" name="temporary-path" value="/tmp"/> -->
|
|
60
|
+
<policy domain="resource" name="memory" value="256MiB"/>
|
|
61
|
+
<policy domain="resource" name="map" value="512MiB"/>
|
|
62
|
+
<policy domain="resource" name="width" value="16KP"/>
|
|
63
|
+
<policy domain="resource" name="height" value="16KP"/>
|
|
64
|
+
<!-- <policy domain="resource" name="list-length" value="128"/> -->
|
|
65
|
+
<policy domain="resource" name="area" value="128MP"/>
|
|
66
|
+
<policy domain="resource" name="disk" value="1GiB"/>
|
|
67
|
+
<!-- <policy domain="resource" name="file" value="768"/> -->
|
|
68
|
+
<!-- <policy domain="resource" name="thread" value="4"/> -->
|
|
69
|
+
<!-- <policy domain="resource" name="throttle" value="0"/> -->
|
|
70
|
+
<!-- <policy domain="resource" name="time" value="3600"/> -->
|
|
71
|
+
<!-- <policy domain="coder" rights="none" pattern="MVG" /> -->
|
|
72
|
+
<!-- <policy domain="module" rights="none" pattern="{PS,PDF,XPS}" /> -->
|
|
73
|
+
<!-- <policy domain="path" rights="none" pattern="@*" /> -->
|
|
74
|
+
<!-- <policy domain="cache" name="memory-map" value="anonymous"/> -->
|
|
75
|
+
<!-- <policy domain="cache" name="synchronize" value="True"/> -->
|
|
76
|
+
<!-- <policy domain="cache" name="shared-secret" value="passphrase" stealth="true"/> -->
|
|
77
|
+
<!-- <policy domain="system" name="max-memory-request" value="256MiB"/> -->
|
|
78
|
+
<!-- <policy domain="system" name="shred" value="2"/> -->
|
|
79
|
+
<!-- <policy domain="system" name="precision" value="6"/> -->
|
|
80
|
+
<!-- <policy domain="system" name="font" value="/path/to/font.ttf"/> -->
|
|
81
|
+
<!-- <policy domain="system" name="pixel-cache-memory" value="anonymous"/> -->
|
|
82
|
+
<!-- <policy domain="system" name="shred" value="2"/> -->
|
|
83
|
+
<!-- <policy domain="system" name="precision" value="6"/> -->
|
|
84
|
+
<!-- not needed due to the need to use explicitly by mvg: -->
|
|
85
|
+
<!-- <policy domain="delegate" rights="none" pattern="MVG" /> -->
|
|
86
|
+
<!-- use curl -->
|
|
87
|
+
<policy domain="delegate" rights="none" pattern="URL" />
|
|
88
|
+
<policy domain="delegate" rights="none" pattern="HTTPS" />
|
|
89
|
+
<policy domain="delegate" rights="none" pattern="HTTP" />
|
|
90
|
+
<!-- in order to avoid to get image with password text -->
|
|
91
|
+
<policy domain="path" rights="none" pattern="@*"/>
|
|
92
|
+
<!-- disable ghostscript format types -->
|
|
93
|
+
<!-- <policy domain="coder" rights="none" pattern="PS" />
|
|
94
|
+
<policy domain="coder" rights="none" pattern="PS2" />
|
|
95
|
+
<policy domain="coder" rights="none" pattern="PS3" />
|
|
96
|
+
<policy domain="coder" rights="none" pattern="EPS" />
|
|
97
|
+
<policy domain="coder" rights="none" pattern="PDF" />
|
|
98
|
+
<policy domain="coder" rights="none" pattern="XPS" /> -->
|
|
99
|
+
</policymap>
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
services:
|
|
2
2
|
mysql:
|
|
3
|
+
platform: linux/amd64
|
|
3
4
|
image: mysql:8.0.23
|
|
4
5
|
networks:
|
|
5
6
|
- default
|
|
@@ -16,6 +17,7 @@ services:
|
|
|
16
17
|
- seccomp:unconfined
|
|
17
18
|
command: --default-authentication-plugin=mysql_native_password
|
|
18
19
|
apache:
|
|
20
|
+
platform: linux/amd64
|
|
19
21
|
image: bitnami/apache:2.4.51
|
|
20
22
|
networks:
|
|
21
23
|
- default
|
|
@@ -30,10 +32,11 @@ services:
|
|
|
30
32
|
ports:
|
|
31
33
|
- "${PORT_WEB:-8000}:8080"
|
|
32
34
|
php:
|
|
35
|
+
platform: linux/amd64
|
|
33
36
|
build:
|
|
34
37
|
context: ./php/
|
|
35
38
|
dockerfile: Dockerfile
|
|
36
|
-
image: lab-env/drupal/9/php:0.0.
|
|
39
|
+
image: lab-env/drupal/9/php:0.0.3
|
|
37
40
|
init: true
|
|
38
41
|
working_dir: /app
|
|
39
42
|
networks:
|
|
@@ -51,6 +54,7 @@ services:
|
|
|
51
54
|
- vendor:/app/vendor
|
|
52
55
|
- drupal:/app/web
|
|
53
56
|
core:
|
|
57
|
+
platform: linux/amd64
|
|
54
58
|
volumes:
|
|
55
59
|
- drupal:/app/web
|
|
56
60
|
|
package/drupal/9/php/Dockerfile
CHANGED
|
@@ -6,12 +6,6 @@ MAINTAINER Mike Mellor
|
|
|
6
6
|
RUN apt-get update && \
|
|
7
7
|
apt-get install -y mariadb-client
|
|
8
8
|
|
|
9
|
-
# Install Imagemagick
|
|
10
|
-
RUN apt-get install -y libmagickwand-dev --no-install-recommends
|
|
11
|
-
|
|
12
|
-
# PHP Imagick ext
|
|
13
|
-
RUN pecl install imagick && docker-php-ext-enable imagick
|
|
14
|
-
|
|
15
9
|
# Install ghostscript
|
|
16
10
|
RUN apt-get install -y ghostscript
|
|
17
11
|
|
package/globals.js
CHANGED
|
@@ -3,6 +3,7 @@ const path = require('path');
|
|
|
3
3
|
const { lstatSync, readdirSync, copyFileSync, existsSync } = require('fs');
|
|
4
4
|
const semver = require('semver');
|
|
5
5
|
const getPort = require('get-port');
|
|
6
|
+
const utilities = require('./commands/create/libs/utilities');
|
|
6
7
|
|
|
7
8
|
process.env.DIRNAME = __dirname;
|
|
8
9
|
|
|
@@ -31,7 +32,7 @@ try{ pkg = require(path.join(process.cwd(), 'package.json')); } catch(e){}
|
|
|
31
32
|
|
|
32
33
|
try{ composer = require(path.join(process.cwd(), 'composer.json')); } catch(e){}
|
|
33
34
|
|
|
34
|
-
try{ wordpress = existsSync(path.join(process.cwd(), '
|
|
35
|
+
try{ wordpress = existsSync(path.join(process.cwd(), 'wp-content/')); } catch(e){}
|
|
35
36
|
|
|
36
37
|
if(composer && composer.require && composer.require['laravel/framework']){
|
|
37
38
|
platform = 'laravel';
|
|
@@ -42,6 +43,14 @@ if(composer && composer.require && composer.require['laravel/framework']){
|
|
|
42
43
|
} else if(wordpress) {
|
|
43
44
|
platform = 'wordpress';
|
|
44
45
|
} else {
|
|
46
|
+
// Check for old wordpress repo stucture and show warning
|
|
47
|
+
try{
|
|
48
|
+
if(existsSync(path.join(process.cwd(), 'themes/'))){
|
|
49
|
+
console.log(`This wordpress repo needs migrating to the new repo structure: \n${utilities.colorize(`https://demo.fishawack.solutions/Lab/Doc/#lab-env-migrating-200`, 'title')}`)
|
|
50
|
+
process.exit(1);
|
|
51
|
+
}
|
|
52
|
+
} catch(e){}
|
|
53
|
+
|
|
45
54
|
platform = 'core';
|
|
46
55
|
}
|
|
47
56
|
|
package/intercept.sh
CHANGED
|
@@ -20,6 +20,10 @@ craft(){
|
|
|
20
20
|
command lab-env craft "$@"
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
+
wp(){
|
|
24
|
+
command lab-env wp "$@"
|
|
25
|
+
}
|
|
26
|
+
|
|
23
27
|
php(){
|
|
24
28
|
command lab-env php "$@"
|
|
25
29
|
}
|
|
@@ -41,6 +45,7 @@ export -f composer;
|
|
|
41
45
|
export -f drush;
|
|
42
46
|
export -f artisan;
|
|
43
47
|
export -f craft;
|
|
48
|
+
export -f wp;
|
|
44
49
|
export -f php;
|
|
45
50
|
export -f chown;
|
|
46
51
|
export -f chmod;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
services:
|
|
2
2
|
mysql:
|
|
3
|
+
platform: linux/amd64
|
|
3
4
|
image: mysql:5.7
|
|
4
5
|
networks:
|
|
5
6
|
- default
|
|
@@ -13,6 +14,7 @@ services:
|
|
|
13
14
|
volumes:
|
|
14
15
|
- mysql:/var/lib/mysql
|
|
15
16
|
nginx:
|
|
17
|
+
platform: linux/amd64
|
|
16
18
|
image: nginx:1.19
|
|
17
19
|
networks:
|
|
18
20
|
- default
|
|
@@ -22,10 +24,11 @@ services:
|
|
|
22
24
|
ports:
|
|
23
25
|
- "${PORT_WEB:-8000}:80"
|
|
24
26
|
php:
|
|
27
|
+
platform: linux/amd64
|
|
25
28
|
build:
|
|
26
29
|
context: ./php/
|
|
27
30
|
dockerfile: Dockerfile
|
|
28
|
-
image: lab-env/laravel/8/php:0.0.
|
|
31
|
+
image: lab-env/laravel/8/php:0.0.2
|
|
29
32
|
init: true
|
|
30
33
|
working_dir: /app
|
|
31
34
|
networks:
|
|
@@ -36,6 +39,7 @@ services:
|
|
|
36
39
|
- ./php/policy.xml:/etc/ImageMagick-6/policy.xml
|
|
37
40
|
- vendor:/app/vendor
|
|
38
41
|
redis:
|
|
42
|
+
platform: linux/amd64
|
|
39
43
|
image: redis:alpine
|
|
40
44
|
networks:
|
|
41
45
|
- default
|
package/laravel/8/php/Dockerfile
CHANGED
|
@@ -2,15 +2,9 @@ FROM chialab/php:7.4-fpm
|
|
|
2
2
|
|
|
3
3
|
MAINTAINER Mike Mellor
|
|
4
4
|
|
|
5
|
-
# Install Imagemagick
|
|
6
|
-
RUN apt-get update && \
|
|
7
|
-
apt-get install -y libmagickwand-dev --no-install-recommends
|
|
8
|
-
|
|
9
|
-
# PHP Imagick ext
|
|
10
|
-
RUN pecl install imagick && docker-php-ext-enable imagick
|
|
11
|
-
|
|
12
5
|
# Install ghostscript
|
|
13
|
-
RUN apt-get
|
|
6
|
+
RUN apt-get update && \
|
|
7
|
+
apt-get install -y ghostscript
|
|
14
8
|
|
|
15
9
|
# Cleanup apt-get install folders
|
|
16
10
|
RUN apt-get clean && \
|
package/package.json
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
services:
|
|
2
2
|
mysql:
|
|
3
|
+
platform: linux/amd64
|
|
3
4
|
image: mysql:5.7
|
|
4
5
|
networks:
|
|
5
6
|
- default
|
|
@@ -13,22 +14,33 @@ services:
|
|
|
13
14
|
volumes:
|
|
14
15
|
- mysql:/var/lib/mysql
|
|
15
16
|
wordpress:
|
|
16
|
-
|
|
17
|
+
platform: linux/amd64
|
|
18
|
+
build:
|
|
19
|
+
context: ./wordpress/
|
|
20
|
+
dockerfile: Dockerfile
|
|
21
|
+
image: lab-env/wordpress/5.7.2/wordpress:0.0.1
|
|
17
22
|
networks:
|
|
18
23
|
- default
|
|
19
24
|
environment:
|
|
20
|
-
|
|
25
|
+
WORDPRESS_DB_NAME: ${DB_DATABASE}
|
|
21
26
|
WORDPRESS_DB_USER: ${DB_USERNAME}
|
|
22
27
|
WORDPRESS_DB_PASSWORD: ${DB_PASSWORD}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
+
WORDPRESS_DB_HOST: ${DB_HOST}
|
|
29
|
+
WORDPRESS_DB_CHARSET: ${DB_CHARSET}
|
|
30
|
+
WORDPRESS_DB_COLLATE: ${DB_COLLATE}
|
|
31
|
+
WORDPRESS_AUTH_KEY: ${AUTH_KEY}
|
|
32
|
+
WORDPRESS_SECURE_AUTH: ${SECURE_AUTH}
|
|
33
|
+
WORDPRESS_LOGGED_IN: ${LOGGED_IN}
|
|
34
|
+
WORDPRESS_NONCE_KEY: ${NONCE_KEY}
|
|
35
|
+
WORDPRESS_AUTH_SALT: ${AUTH_SALT}
|
|
36
|
+
WORDPRESS_SECURE_AUTH: ${SECURE_AUTH}
|
|
37
|
+
WORDPRESS_LOGGED_IN: ${LOGGED_IN}
|
|
38
|
+
WORDPRESS_NONCE_SALT: ${NONCE_SALT}
|
|
39
|
+
WORDPRESS_TABLE_PREFIX: ${TABLE_PREFIX}
|
|
40
|
+
WORDPRESS_DEBUG: ${DEBUG}
|
|
41
|
+
WORDPRESS_CONFIG_EXTRA: ${CONFIG_EXTRA}
|
|
28
42
|
volumes:
|
|
29
|
-
- $CWD
|
|
30
|
-
- $CWD/plugins:/var/www/html/wp-content/plugins
|
|
31
|
-
- $CWD/uploads:/var/www/html/wp-content/uploads
|
|
43
|
+
- $CWD/:/var/www/html
|
|
32
44
|
- ./apache/uploads.ini:/usr/local/etc/php/conf.d/uploads.ini
|
|
33
45
|
- ./apache/.htaccess:/var/www/html/.htaccess
|
|
34
46
|
ports:
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
FROM wordpress:5.7.2
|
|
2
|
+
|
|
3
|
+
MAINTAINER Mike Mellor
|
|
4
|
+
|
|
5
|
+
# Install mysql client
|
|
6
|
+
RUN apt-get update && \
|
|
7
|
+
apt-get install -y mariadb-client
|
|
8
|
+
|
|
9
|
+
# Install wordpress cli
|
|
10
|
+
RUN curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar && \
|
|
11
|
+
chmod +x wp-cli.phar && \
|
|
12
|
+
mv wp-cli.phar /usr/local/bin/wp
|
|
13
|
+
|
|
14
|
+
# Cleanup apt-get install folders
|
|
15
|
+
RUN apt-get clean && \
|
|
16
|
+
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|