@fishawack/lab-env 5.9.0 → 5.10.0

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.
Files changed (47) hide show
  1. package/CHANGELOG.md +50 -0
  2. package/_Test/config-drupal.js +197 -0
  3. package/_Test/config-laravel.js +239 -0
  4. package/_Test/config-wordpress.js +200 -0
  5. package/_Test/force-managed-updates.js +1 -0
  6. package/bitbucket-pipelines.yml +2 -0
  7. package/commands/create/libs/runtime-versions.js +34 -0
  8. package/commands/create/services/aws/elasticbeanstalk.js +3 -2
  9. package/craftcms/3/docker-compose.yml +7 -5
  10. package/craftcms/3/php/Dockerfile +2 -1
  11. package/drupal/10/docker-compose.yml +71 -0
  12. package/drupal/10/php/CHANGELOG.md +4 -0
  13. package/drupal/10/php/Dockerfile +44 -0
  14. package/drupal/10/php/custom.ini +5 -0
  15. package/drupal/10/php/entrypoint.sh +27 -0
  16. package/drupal/10/php/package.json +11 -0
  17. package/drupal/10/php/policy.xml +99 -0
  18. package/drupal/9/docker-compose.yml +7 -5
  19. package/drupal/9/php/Dockerfile +2 -1
  20. package/globals.js +283 -209
  21. package/laravel/10/docker-compose.yml +3 -1
  22. package/laravel/10/php/CHANGELOG.md +3 -0
  23. package/laravel/10/php/Dockerfile +3 -2
  24. package/laravel/10/php/package.json +1 -1
  25. package/laravel/11/docker-compose.yml +92 -0
  26. package/laravel/11/php/CHANGELOG.md +4 -0
  27. package/laravel/11/php/Dockerfile +48 -0
  28. package/laravel/11/php/custom.ini +5 -0
  29. package/laravel/11/php/entrypoint.sh +27 -0
  30. package/laravel/11/php/package.json +11 -0
  31. package/laravel/11/php/policy.xml +99 -0
  32. package/laravel/8/docker-compose.yml +3 -1
  33. package/laravel/8/php/Dockerfile +2 -1
  34. package/laravel/9/docker-compose.yml +3 -1
  35. package/laravel/9/php/Dockerfile +2 -1
  36. package/package.json +1 -1
  37. package/php/8.2/Dockerfile +1 -1
  38. package/wordpress/1/docker-compose.yml +7 -5
  39. package/wordpress/1/php/Dockerfile +2 -1
  40. package/wordpress/2/docker-compose.yml +63 -0
  41. package/wordpress/2/php/CHANGELOG.md +4 -0
  42. package/wordpress/2/php/Dockerfile +44 -0
  43. package/wordpress/2/php/custom.ini +5 -0
  44. package/wordpress/2/php/entrypoint.sh +27 -0
  45. package/wordpress/2/php/package.json +11 -0
  46. package/wordpress/2/php/policy.xml +99 -0
  47. /package/_Ai/{laravel-12.md → laravel-@.md} +0 -0
@@ -0,0 +1,92 @@
1
+ services:
2
+ mysql:
3
+ image: mysql:${FW_LARAVEL_11_MYSQL_RUNTIME:-8.4}
4
+ networks:
5
+ - default
6
+ environment:
7
+ - MYSQL_ROOT_PASSWORD=password
8
+ - MYSQL_DATABASE=${DB_DATABASE}
9
+ - MYSQL_USER=${DB_USERNAME}
10
+ - MYSQL_PASSWORD=${DB_PASSWORD}
11
+ ports:
12
+ - "${PORT_DB:-3306}:3306"
13
+ volumes:
14
+ - mysql:/var/lib/mysql
15
+ nginx:
16
+ build:
17
+ context: $FW_LARAVEL_8_NGINX_CONTEXT
18
+ target: development
19
+ image: $FW_LARAVEL_8_NGINX_IMAGE:${FW_LARAVEL_8_NGINX_VERSION:-latest}
20
+ networks:
21
+ - default
22
+ volumes:
23
+ - $CWD/:/app
24
+ ports:
25
+ - "${PORT_WEB:-8000}:80"
26
+ depends_on:
27
+ - php
28
+ php:
29
+ build:
30
+ context: $FW_LARAVEL_11_PHP_CONTEXT
31
+ target: development
32
+ args:
33
+ PHP_VERSION: ${FW_LARAVEL_11_PHP_RUNTIME:-8.5}
34
+ image: $FW_LARAVEL_11_PHP_IMAGE:${FW_LARAVEL_11_PHP_VERSION:-latest}
35
+ platform: ${FW_LARAVEL_11_PHP_PLATFORM:-}
36
+ init: true
37
+ working_dir: /app
38
+ networks:
39
+ - default
40
+ env_file:
41
+ - path: $CWD/.env.ci
42
+ required: false
43
+ volumes:
44
+ - $CWD/:/app
45
+ - vendor:/app/vendor
46
+ - $FW_DIR/.ssh:/home/php/.ssh
47
+ - $DIRNAME/_Shared/mysql-client/.my.cnf:/home/php/.my.cnf:ro
48
+ environment:
49
+ - FW_ROOT=${FW_ROOT:-}
50
+ - USER_UID=${USER_UID:-0}
51
+ - USER_GID=${USER_GID:-0}
52
+ redis:
53
+ image: redis:alpine
54
+ networks:
55
+ - default
56
+ volumes:
57
+ - redis:/data
58
+ search:
59
+ image: opensearchproject/opensearch:2.19.3
60
+ environment:
61
+ - discovery.type=single-node
62
+ - bootstrap.memory_lock=true
63
+ - OPENSEARCH_JAVA_OPTS=-Xms512m -Xmx512m
64
+ - DISABLE_SECURITY_PLUGIN=true
65
+ - cluster.name=dev-cluster-1
66
+ - node.name=dev-node-1
67
+ networks:
68
+ - default
69
+ ports:
70
+ - "${PORT_ES:-9200}:9200"
71
+ volumes:
72
+ - search:/usr/share/opensearch/data
73
+ mem_limit: 2G
74
+ ulimits:
75
+ memlock:
76
+ soft: -1
77
+ hard: -1
78
+ nofile:
79
+ soft: 65536
80
+ hard: 65536
81
+ networks:
82
+ default:
83
+ driver: "bridge"
84
+ volumes:
85
+ vendor:
86
+ driver: "local"
87
+ mysql:
88
+ driver: "local"
89
+ redis:
90
+ driver: "local"
91
+ search:
92
+ driver: "local"
@@ -0,0 +1,4 @@
1
+ ## Changelog
2
+
3
+ ### 1.0.0 (2026-11-09)
4
+ * [Misc] initial commit, PHP 8.5
@@ -0,0 +1,48 @@
1
+ ARG PHP_VERSION
2
+ FROM chialab/php:${PHP_VERSION}-fpm AS development
3
+
4
+ LABEL org.opencontainers.image.authors="Mike Mellor <mike.mellor@avalerehealth.com>"
5
+
6
+ # Install ghostscript
7
+ RUN apt-get update && \
8
+ apt-get install -y ghostscript
9
+
10
+ # Copy custom.ini
11
+ COPY ./custom.ini /usr/local/etc/php/conf.d/custom.ini
12
+
13
+ # Copy ImageMagick policy
14
+ COPY ./policy.xml /etc/ImageMagick-6/policy.xml
15
+
16
+ # Install mysql client for dumps & schema imports in laravel (need to address a mismatch of versions here at some later)
17
+ RUN apt-get update && \
18
+ apt-get install -y mariadb-client
19
+
20
+ # Add php user
21
+ RUN useradd -m -G www-data -s /bin/bash php
22
+
23
+ # Set safe directory to remove intel errors when running git rev-parse
24
+ RUN su php -c "git config --global --add safe.directory /app"
25
+
26
+ # Change composer home dir
27
+ ENV COMPOSER_HOME=/home/php/.composer
28
+
29
+ # Cleanup apt-get install folders
30
+ RUN apt-get clean && \
31
+ rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
32
+
33
+ COPY entrypoint.sh /bin/entrypoint.sh
34
+ RUN chmod +x /bin/entrypoint.sh
35
+ ENTRYPOINT ["/bin/entrypoint.sh"]
36
+
37
+ CMD ["php-fpm"]
38
+
39
+ FROM fishawack/lab-env-laravel-11-php:latest AS production
40
+
41
+ # Copy source code into container
42
+ COPY . /app
43
+
44
+ # Install composer dependencies
45
+ RUN TEMPFILE=$(mktemp) && \
46
+ curl -o "$TEMPFILE" "https://getcomposer.org/installer" && \
47
+ php <"$TEMPFILE" && \
48
+ ./composer.phar install -d /app --no-dev --no-interaction --no-ansi --optimize-autoloader
@@ -0,0 +1,5 @@
1
+ file_uploads = On
2
+ memory_limit = 500M
3
+ upload_max_filesize = 500M
4
+ post_max_size = 500M
5
+ max_execution_time = 600
@@ -0,0 +1,27 @@
1
+ #!/bin/bash
2
+
3
+ # Setting $FW_ROOT will bypass the user switch to php
4
+ if [ -z "$FW_ROOT" ]; then
5
+ # Set php user id to match host users id so no permission issues outside of docker
6
+ usermod -u $USER_UID php &>/dev/null
7
+
8
+ # Fix access rights to stdout and stderr
9
+ chown php /proc/self/fd/{1,2}
10
+
11
+ # Own the vendor folder otherwise it'll be owned by root/previous php id which will prevent writing
12
+ chown php /app/vendor
13
+
14
+ # Own the php home directory without following symlinks
15
+ chown -Rh php /home/php
16
+
17
+ # If bash command then start an non login interactive shell
18
+ if [[ "$@" == "bash" ]]; then
19
+ exec su php
20
+ # Otherwise pipe the command into the non login non interactive shell as a command to exec
21
+ else
22
+ exec su php -c "$@"
23
+ fi
24
+ else
25
+ echo "Accessing as root"
26
+ exec "$@"
27
+ fi
@@ -0,0 +1,11 @@
1
+ {
2
+ "name": "php",
3
+ "version": "1.0.0",
4
+ "description": "lab-env docker config for the php module",
5
+ "scripts": {
6
+ "preversion": "docker login",
7
+ "postversion": "docker buildx build --target development --platform linux/amd64,linux/arm64 -t fishawack/lab-env-laravel-11-php:$npm_package_version -t fishawack/lab-env-laravel-11-php:latest --push . && git add . && git commit -m \"build: bumped fishawack/lab-env-laravel-11-php to $npm_package_version\""
8
+ },
9
+ "author": "Mike Mellor",
10
+ "license": "ISC"
11
+ }
@@ -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,7 +1,7 @@
1
1
  services:
2
2
  mysql:
3
3
  platform: linux/amd64
4
- image: mysql:5.7
4
+ image: mysql:${FW_LARAVEL_8_MYSQL_RUNTIME:-5.7}
5
5
  networks:
6
6
  - default
7
7
  environment:
@@ -30,6 +30,8 @@ services:
30
30
  build:
31
31
  context: $DIRNAME/laravel/8/php/
32
32
  target: development
33
+ args:
34
+ PHP_VERSION: ${FW_LARAVEL_8_PHP_RUNTIME:-7.4}
33
35
  image: fishawack/lab-env-laravel-8-php:${FW_LARAVEL_8_PHP_VERSION:-latest}
34
36
  init: true
35
37
  working_dir: /app
@@ -1,4 +1,5 @@
1
- FROM chialab/php:7.4-fpm AS development
1
+ ARG PHP_VERSION
2
+ FROM chialab/php:${PHP_VERSION}-fpm AS development
2
3
 
3
4
  LABEL org.opencontainers.image.authors="Mike Mellor <mike.mellor@avalerehealth.com>"
4
5
 
@@ -1,6 +1,6 @@
1
1
  services:
2
2
  mysql:
3
- image: mysql:8.4
3
+ image: mysql:${FW_LARAVEL_9_MYSQL_RUNTIME:-8.4}
4
4
  networks:
5
5
  - default
6
6
  environment:
@@ -29,6 +29,8 @@ services:
29
29
  build:
30
30
  context: $FW_LARAVEL_9_PHP_CONTEXT
31
31
  target: development
32
+ args:
33
+ PHP_VERSION: ${FW_LARAVEL_9_PHP_RUNTIME:-8.2}
32
34
  image: $FW_LARAVEL_9_PHP_IMAGE:${FW_LARAVEL_9_PHP_VERSION:-latest}
33
35
  platform: ${FW_LARAVEL_9_PHP_PLATFORM:-}
34
36
  init: true
@@ -1,4 +1,5 @@
1
- FROM chialab/php:8.2-fpm AS development
1
+ ARG PHP_VERSION
2
+ FROM chialab/php:${PHP_VERSION}-fpm AS development
2
3
 
3
4
  LABEL org.opencontainers.image.authors="Mike Mellor <mike.mellor@avalerehealth.com>"
4
5
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fishawack/lab-env",
3
- "version": "5.9.0",
3
+ "version": "5.10.0",
4
4
  "description": "Docker manager for FW",
5
5
  "main": "cli.js",
6
6
  "scripts": {
@@ -31,7 +31,7 @@ ENTRYPOINT ["/bin/entrypoint.sh"]
31
31
 
32
32
  CMD ["php-fpm"]
33
33
 
34
- FROM fishawack/lab-env-laravel-9-php:latest AS production
34
+ FROM fishawack/lab-env-php-8-2:latest AS production
35
35
 
36
36
  # Copy source code into container
37
37
  COPY . /app
@@ -1,6 +1,6 @@
1
1
  services:
2
2
  mysql:
3
- image: mysql:8.4
3
+ image: mysql:${FW_WORDPRESS_1_MYSQL_RUNTIME:-8.4}
4
4
  networks:
5
5
  - default
6
6
  environment:
@@ -16,9 +16,9 @@ services:
16
16
  - seccomp:unconfined
17
17
  apache:
18
18
  build:
19
- context: $DIRNAME/wordpress/1/apache/
19
+ context: $FW_WORDPRESS_1_APACHE_CONTEXT
20
20
  target: development
21
- image: fishawack/lab-env-wordpress-1-apache:${FW_WORDPRESS_1_APACHE_VERSION:-latest}
21
+ image: $FW_WORDPRESS_1_APACHE_IMAGE:${FW_WORDPRESS_1_APACHE_VERSION:-latest}
22
22
  working_dir: /app
23
23
  networks:
24
24
  - default
@@ -29,9 +29,11 @@ services:
29
29
  - "${PORT_WEB:-8000}:8080"
30
30
  php:
31
31
  build:
32
- context: $DIRNAME/wordpress/1/php/
32
+ context: $FW_WORDPRESS_1_PHP_CONTEXT
33
33
  target: development
34
- image: fishawack/lab-env-wordpress-1-php:${FW_WORDPRESS_1_PHP_VERSION:-latest}
34
+ args:
35
+ PHP_VERSION: ${FW_WORDPRESS_1_PHP_RUNTIME:-8.2}
36
+ image: $FW_WORDPRESS_1_PHP_IMAGE:${FW_WORDPRESS_1_PHP_VERSION:-latest}
35
37
  init: true
36
38
  working_dir: /app
37
39
  networks:
@@ -1,4 +1,5 @@
1
- FROM chialab/php:8.2-fpm AS development
1
+ ARG PHP_VERSION
2
+ FROM chialab/php:${PHP_VERSION}-fpm AS development
2
3
 
3
4
  LABEL org.opencontainers.image.authors="Mike Mellor <mike.mellor@avalerehealth.com>"
4
5
 
@@ -0,0 +1,63 @@
1
+ services:
2
+ mysql:
3
+ image: mysql:${FW_WORDPRESS_2_MYSQL_RUNTIME:-8.4}
4
+ networks:
5
+ - default
6
+ environment:
7
+ - MYSQL_ROOT_PASSWORD=password
8
+ - MYSQL_DATABASE=${DB_DATABASE}
9
+ - MYSQL_USER=${DB_USERNAME}
10
+ - MYSQL_PASSWORD=${DB_PASSWORD}
11
+ ports:
12
+ - "${PORT_DB:-3306}:3306"
13
+ volumes:
14
+ - mysql:/var/lib/mysql
15
+ security_opt:
16
+ - seccomp:unconfined
17
+ apache:
18
+ build:
19
+ context: $FW_WORDPRESS_1_APACHE_CONTEXT
20
+ target: development
21
+ image: $FW_WORDPRESS_1_APACHE_IMAGE:${FW_WORDPRESS_1_APACHE_VERSION:-latest}
22
+ working_dir: /app
23
+ networks:
24
+ - default
25
+ volumes:
26
+ - $CWD/:/app
27
+ - wordpress:/app/wordpress
28
+ ports:
29
+ - "${PORT_WEB:-8000}:8080"
30
+ php:
31
+ build:
32
+ context: $FW_WORDPRESS_2_PHP_CONTEXT
33
+ target: development
34
+ args:
35
+ PHP_VERSION: ${FW_WORDPRESS_2_PHP_RUNTIME:-8.4}
36
+ image: $FW_WORDPRESS_2_PHP_IMAGE:${FW_WORDPRESS_2_PHP_VERSION:-latest}
37
+ init: true
38
+ working_dir: /app
39
+ networks:
40
+ - default
41
+ volumes:
42
+ - $CWD/:/app
43
+ - vendor:/app/vendor
44
+ - wordpress:/app/wordpress
45
+ - $DIRNAME/_Shared/mysql-client/.my.cnf:/home/php/.my.cnf:ro
46
+ environment:
47
+ - FW_ROOT=${FW_ROOT:-}
48
+ - USER_UID=${USER_UID:-0}
49
+ - USER_GID=${USER_GID:-0}
50
+ core:
51
+ volumes:
52
+ - wordpress:/app/wordpress
53
+
54
+ networks:
55
+ default:
56
+ driver: "bridge"
57
+ volumes:
58
+ vendor:
59
+ driver: "local"
60
+ mysql:
61
+ driver: "local"
62
+ wordpress:
63
+ driver: "local"
@@ -0,0 +1,4 @@
1
+ ## Changelog
2
+
3
+ ### 1.0.0 (2026-11-09)
4
+ * [Misc] initial commit, PHP 8.4
@@ -0,0 +1,44 @@
1
+ ARG PHP_VERSION
2
+ FROM chialab/php:${PHP_VERSION}-fpm AS development
3
+
4
+ LABEL org.opencontainers.image.authors="Mike Mellor <mike.mellor@avalerehealth.com>"
5
+
6
+ # Install ghostscript
7
+ RUN apt-get update && \
8
+ apt-get install -y ghostscript
9
+
10
+ # Install mysql client
11
+ RUN apt-get install -y mariadb-client
12
+
13
+ # Copy custom.ini
14
+ COPY ./custom.ini /usr/local/etc/php/conf.d/custom.ini
15
+
16
+ # Copy ImageMagick policy
17
+ COPY ./policy.xml /etc/ImageMagick-6/policy.xml
18
+
19
+ # Add php user
20
+ RUN useradd -m -G www-data -s /bin/bash php
21
+
22
+ # Change composer home dir
23
+ ENV COMPOSER_HOME=/home/php/.composer
24
+
25
+ # Cleanup apt-get install folders
26
+ RUN apt-get clean && \
27
+ rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
28
+
29
+ COPY entrypoint.sh /bin/entrypoint.sh
30
+ RUN chmod +x /bin/entrypoint.sh
31
+ ENTRYPOINT ["/bin/entrypoint.sh"]
32
+
33
+ CMD ["php-fpm"]
34
+
35
+ FROM fishawack/lab-env-wordpress-2-php:latest AS production
36
+
37
+ # Copy source code into container
38
+ COPY . /app
39
+
40
+ # Install composer dependencies
41
+ RUN TEMPFILE=$(mktemp) && \
42
+ curl -o "$TEMPFILE" "https://getcomposer.org/installer" && \
43
+ php <"$TEMPFILE" && \
44
+ ./composer.phar install -d /app --no-dev --no-interaction --no-ansi --optimize-autoloader
@@ -0,0 +1,5 @@
1
+ file_uploads = On
2
+ memory_limit = 500M
3
+ upload_max_filesize = 500M
4
+ post_max_size = 500M
5
+ max_execution_time = 600
@@ -0,0 +1,27 @@
1
+ #!/bin/bash
2
+
3
+ # Setting $FW_ROOT will bypass the user switch to php
4
+ if [ -z "$FW_ROOT" ]; then
5
+ # Set php user id to match host users id so no permission issues outside of docker
6
+ usermod -u $USER_UID php &>/dev/null
7
+
8
+ # Fix access rights to stdout and stderr
9
+ chown php /proc/self/fd/{1,2}
10
+
11
+ # Own the vendor folder otherwise it'll be owned by root/previous php id which will prevent writing
12
+ chown php /app/vendor
13
+
14
+ # Own the wordpress folder otherwise it'll be owned by root/previous php id which will prevent writing
15
+ chown php /app/wordpress
16
+
17
+ # If bash command then start an non login interactive shell
18
+ if [[ "$@" == "bash" ]]; then
19
+ exec su php
20
+ # Otherwise pipe the command into the non login non interactive shell as a command to exec
21
+ else
22
+ exec su php -c "$@"
23
+ fi
24
+ else
25
+ echo "Accessing as root"
26
+ exec "$@"
27
+ fi
@@ -0,0 +1,11 @@
1
+ {
2
+ "name": "php",
3
+ "version": "1.0.0",
4
+ "description": "lab-env docker config for the php module",
5
+ "scripts": {
6
+ "preversion": "docker login",
7
+ "postversion": "docker buildx build --target development --platform linux/amd64,linux/arm64 -t fishawack/lab-env-wordpress-2-php:$npm_package_version -t fishawack/lab-env-wordpress-2-php:latest --push . && git add . && git commit -m \"build: bumped fishawack/lab-env-wordpress-2-php to $npm_package_version\""
8
+ },
9
+ "author": "Mike Mellor",
10
+ "license": "ISC"
11
+ }