@scandipwa/magento-scripts 2.0.0-alpha.9 → 2.0.1
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/lib/commands/cli.js +18 -1
- package/lib/commands/logs.js +28 -2
- package/lib/commands/start.js +24 -3
- package/lib/commands/status.js +19 -1
- package/lib/config/config.js +20 -2
- package/lib/config/dependencies-for-platforms.js +1 -113
- package/lib/config/docker.js +94 -54
- package/lib/config/get-project-configuration.js +5 -0
- package/lib/config/index.js +10 -3
- package/lib/config/magento/required-php-extensions/index.js +1 -1
- package/lib/config/php-config.js +4 -3
- package/lib/config/port-config.js +3 -1
- package/lib/config/services/composer/versions/composer-1.js +13 -0
- package/lib/config/services/composer/versions/composer-2.js +8 -0
- package/lib/config/services/composer/versions/index.js +4 -0
- package/lib/config/services/elasticsearch/versions/elasticsearch-7.10.js +11 -0
- package/lib/config/services/elasticsearch/versions/elasticsearch-7.12.js +11 -0
- package/lib/config/services/elasticsearch/versions/elasticsearch-7.16.js +11 -0
- package/lib/config/services/elasticsearch/versions/elasticsearch-7.17.js +11 -0
- package/lib/config/services/elasticsearch/versions/elasticsearch-7.6.js +11 -0
- package/lib/config/services/elasticsearch/versions/elasticsearch-7.7.js +11 -0
- package/lib/config/services/elasticsearch/versions/elasticsearch-7.9.js +11 -0
- package/lib/config/services/elasticsearch/versions/index.js +15 -1
- package/lib/config/services/maildev/index.js +7 -0
- package/lib/config/services/mariadb/versions/index.js +5 -0
- package/lib/config/services/mariadb/versions/mariadb-10.2.js +8 -0
- package/lib/config/services/mariadb/versions/mariadb-10.3.js +8 -0
- package/lib/config/services/mariadb/versions/mariadb-10.4.js +8 -0
- package/lib/config/services/nginx/versions/index.js +3 -0
- package/lib/config/services/nginx/versions/nginx-1.18.js +11 -0
- package/lib/config/{php → services/php}/base-repo.js +0 -0
- package/lib/config/{php → services/php}/extensions/apcu.js +0 -0
- package/lib/config/{php → services/php}/extensions/bcmath.js +0 -0
- package/lib/config/{php → services/php}/extensions/curl.js +0 -0
- package/lib/config/{php → services/php}/extensions/gd.js +0 -0
- package/lib/config/{php → services/php}/extensions/index.js +0 -0
- package/lib/config/{php → services/php}/extensions/intl.js +0 -0
- package/lib/config/{php → services/php}/extensions/opcache.js +0 -0
- package/lib/config/{php → services/php}/extensions/pdo_mysql.js +0 -0
- package/lib/config/{php → services/php}/extensions/soap.js +0 -0
- package/lib/config/{php → services/php}/extensions/sodium.js +0 -0
- package/lib/config/{php → services/php}/extensions/xdebug.js +0 -0
- package/lib/config/{php → services/php}/extensions/xsl.js +0 -0
- package/lib/config/{php → services/php}/extensions/zip.js +0 -0
- package/lib/config/{php → services/php}/versions/index.js +0 -0
- package/lib/config/{php → services/php}/versions/php-7.2.js +1 -0
- package/lib/config/{php → services/php}/versions/php-7.3.js +1 -0
- package/lib/config/{php → services/php}/versions/php-7.4.js +1 -0
- package/lib/config/{php → services/php}/versions/php-8.1.js +1 -0
- package/lib/config/services/redis/index.js +5 -0
- package/lib/config/services/redis/redis-5.0.js +8 -0
- package/lib/config/services/redis/redis-6.0.js +8 -0
- package/lib/config/services/redis/redis-6.2.js +8 -0
- package/lib/config/{ssl-terminator → services/ssl-terminator}/index.js +3 -0
- package/lib/config/services/varnish/index.js +5 -0
- package/lib/config/{varnish → services/varnish}/varnish-6-0.js +5 -3
- package/lib/config/{varnish → services/varnish}/varnish-6-6.js +5 -3
- package/lib/config/{varnish → services/varnish}/varnish-7-0.js +5 -3
- package/lib/config/templates/magentorc.template +12 -5
- package/lib/config/templates/nginx.fastcgi_params.template +29 -0
- package/lib/config/templates/nginx.template.conf +1 -1
- package/lib/config/templates/php-debug.template.ini +31 -0
- package/lib/config/templates/php-fpm.template.conf +1 -2
- package/lib/config/templates/php.template.ini +5 -201
- package/lib/config/templates/ssl-terminator.template.conf +2 -0
- package/lib/config/templates/varnish.template.vcl +20 -13
- package/lib/config/versions/magento-2.2.10.js +39 -0
- package/lib/config/versions/magento-2.3.0.js +15 -19
- package/lib/config/versions/magento-2.3.1.js +15 -19
- package/lib/config/versions/magento-2.3.2-p1.js +15 -19
- package/lib/config/versions/magento-2.3.2-p2.js +15 -19
- package/lib/config/versions/magento-2.3.2.js +15 -19
- package/lib/config/versions/magento-2.3.3-p1.js +15 -19
- package/lib/config/versions/magento-2.3.3.js +15 -19
- package/lib/config/versions/magento-2.3.4-p1.js +15 -19
- package/lib/config/versions/magento-2.3.4-p2.js +15 -19
- package/lib/config/versions/magento-2.3.4.js +15 -19
- package/lib/config/versions/magento-2.3.5-p1.js +17 -22
- package/lib/config/versions/magento-2.3.5-p2.js +17 -22
- package/lib/config/versions/magento-2.3.5.js +17 -22
- package/lib/config/versions/magento-2.3.6-p1.js +17 -22
- package/lib/config/versions/magento-2.3.6.js +17 -22
- package/lib/config/versions/magento-2.3.7-p1.js +17 -22
- package/lib/config/versions/magento-2.3.7-p2.js +17 -22
- package/lib/config/versions/magento-2.3.7-p3.js +17 -22
- package/lib/config/versions/magento-2.3.7-p4.js +17 -22
- package/lib/config/versions/magento-2.3.7.js +17 -22
- package/lib/config/versions/magento-2.4.0-p1.js +17 -22
- package/lib/config/versions/magento-2.4.0.js +17 -22
- package/lib/config/versions/magento-2.4.1-p1.js +18 -23
- package/lib/config/versions/magento-2.4.1.js +18 -23
- package/lib/config/versions/magento-2.4.2-p1.js +18 -23
- package/lib/config/versions/magento-2.4.2-p2.js +18 -23
- package/lib/config/versions/magento-2.4.2.js +18 -23
- package/lib/config/versions/magento-2.4.3-p1.js +18 -23
- package/lib/config/versions/magento-2.4.3-p2.js +18 -23
- package/lib/config/versions/magento-2.4.3-p3.js +18 -23
- package/lib/config/versions/magento-2.4.3.js +18 -23
- package/lib/config/versions/magento-2.4.4-p1.js +18 -23
- package/lib/config/versions/magento-2.4.4-p2.js +41 -0
- package/lib/config/versions/magento-2.4.4.js +18 -23
- package/lib/config/versions/magento-2.4.5-p1.js +41 -0
- package/lib/config/versions/magento-2.4.5.js +18 -23
- package/lib/tasks/cli/create-bashrc-config.js +4 -2
- package/lib/tasks/composer/local-auth-json.js +1 -1
- package/lib/tasks/database/connect-to-database.js +6 -3
- package/lib/tasks/database/create-magento-database.js +5 -2
- package/lib/tasks/database/create-magento-user.js +50 -0
- package/lib/tasks/database/default-magento-database.js +3 -0
- package/lib/tasks/database/default-magento-user.js +7 -0
- package/lib/tasks/database/import-dump-to-database.js +3 -2
- package/lib/tasks/docker/api.d.ts +25 -1
- package/lib/tasks/docker/api.js +31 -1
- package/lib/tasks/docker/containers/container-api.d.ts +17 -0
- package/lib/tasks/docker/containers/container-api.js +64 -9
- package/lib/tasks/docker/containers/tasks.js +44 -13
- package/lib/tasks/docker/convert-composer-home-to-composer-cache-volume.js +52 -0
- package/lib/tasks/docker/convert-mysql-to-mariadb.js +2 -2
- package/lib/tasks/docker/image/image-api.d.ts +44 -0
- package/lib/tasks/docker/image/image-api.js +30 -2
- package/lib/tasks/docker/index.js +6 -1
- package/lib/tasks/docker/network/tasks.js +19 -14
- package/lib/tasks/docker/project-image-builder.js +39 -14
- package/lib/tasks/docker/system/index.js +5 -0
- package/lib/tasks/docker/system/system-api.d.ts +71 -0
- package/lib/tasks/docker/system/system-api.js +35 -0
- package/lib/tasks/docker/volume/index.js +2 -1
- package/lib/tasks/docker/volume/tasks.js +67 -9
- package/lib/tasks/docker/volume/volume-api.d.ts +40 -0
- package/lib/tasks/docker/volume/volume-api.js +55 -2
- package/lib/tasks/execute.js +5 -2
- package/lib/tasks/file-system/create-nginx-config.js +3 -5
- package/lib/tasks/file-system/create-php-config.js +2 -23
- package/lib/tasks/file-system/create-php-debug-config.js +45 -0
- package/lib/tasks/file-system/create-php-fpm-config.js +2 -4
- package/lib/tasks/file-system/create-phpstorm-config/database-config.js +24 -5
- package/lib/tasks/file-system/create-phpstorm-config/eslint-config.js +25 -13
- package/lib/tasks/file-system/create-phpstorm-config/exclude-folder-config.js +13 -3
- package/lib/tasks/file-system/create-phpstorm-config/index.js +2 -1
- package/lib/tasks/file-system/create-phpstorm-config/inspection-tools-config/custom-ruleset-path-config.js +18 -7
- package/lib/tasks/file-system/create-phpstorm-config/inspection-tools-config/paths.js +4 -0
- package/lib/tasks/file-system/create-ssl-terminator-config.js +23 -8
- package/lib/tasks/file-system/create-varnish-config.js +4 -7
- package/lib/tasks/file-system/create-vscode-config.js +2 -1
- package/lib/tasks/file-system/index.js +3 -2
- package/lib/tasks/magento/setup-magento/configure-elasticsearch.js +2 -4
- package/lib/tasks/magento/setup-magento/flush-redis-config.js +3 -6
- package/lib/tasks/magento/setup-magento/index.js +2 -0
- package/lib/tasks/magento/setup-magento/install-magento.js +8 -13
- package/lib/tasks/magento/setup-magento/set-base-url.js +2 -1
- package/lib/tasks/magento/setup-magento/set-mail-config.js +22 -0
- package/lib/tasks/magento/setup-magento/varnish-config.js +4 -9
- package/lib/tasks/magento/setup-magento/waiting-for-varnish.js +15 -16
- package/lib/tasks/php/php-container.js +1 -1
- package/lib/tasks/php/update-env-php.js +4 -6
- package/lib/tasks/{prefix → project-config}/index.js +6 -6
- package/lib/tasks/requirements/composer-credentials.js +7 -3
- package/lib/tasks/requirements/docker/context.js +88 -0
- package/lib/tasks/requirements/docker/index.js +111 -19
- package/lib/tasks/requirements/docker/install.js +21 -7
- package/lib/tasks/requirements/docker/permissions.js +2 -11
- package/lib/tasks/requirements/docker/running-status.js +94 -24
- package/lib/tasks/requirements/docker/version.js +1 -0
- package/lib/tasks/requirements/index.js +0 -2
- package/lib/tasks/requirements/php-version.js +4 -2
- package/lib/tasks/start.js +27 -8
- package/lib/tasks/status/index.js +86 -21
- package/lib/tasks/stop.js +2 -0
- package/lib/tasks/theme/retrieve-theme-data.js +12 -2
- package/lib/util/config-file-validator.js +17 -3
- package/lib/util/connection-string.js +62 -0
- package/lib/util/execute-in-container.js +7 -8
- package/lib/util/instance-metadata.js +14 -2
- package/lib/util/systemctl.js +62 -13
- package/package.json +2 -2
- package/typings/context.d.ts +11 -0
- package/typings/index.d.ts +46 -1
- package/lib/tasks/requirements/dependency/arch.js +0 -50
- package/lib/tasks/requirements/dependency/centos.js +0 -36
- package/lib/tasks/requirements/dependency/fedora.js +0 -36
- package/lib/tasks/requirements/dependency/index.js +0 -33
- package/lib/tasks/requirements/dependency/mac.js +0 -124
- package/lib/tasks/requirements/dependency/ubuntu.js +0 -83
package/lib/config/docker.js
CHANGED
|
@@ -6,6 +6,8 @@ const { isIpAddress } = require('../util/ip');
|
|
|
6
6
|
const systeminformation = require('systeminformation');
|
|
7
7
|
const { deepmerge } = require('../util/deepmerge');
|
|
8
8
|
const defaultEsEnv = require('./services/elasticsearch/default-es-env');
|
|
9
|
+
const logger = require('@scandipwa/scandipwa-dev-utils/logger');
|
|
10
|
+
const defaultMagentoUser = require('../tasks/database/default-magento-user');
|
|
9
11
|
|
|
10
12
|
/**
|
|
11
13
|
*
|
|
@@ -21,10 +23,11 @@ module.exports = async (ctx, overridenConfiguration, baseConfig) => {
|
|
|
21
23
|
redis,
|
|
22
24
|
elasticsearch,
|
|
23
25
|
mariadb,
|
|
24
|
-
varnish
|
|
26
|
+
varnish,
|
|
27
|
+
maildev
|
|
25
28
|
} = configuration;
|
|
26
29
|
|
|
27
|
-
const php = getPhpConfig(
|
|
30
|
+
const php = getPhpConfig(overridenConfiguration, baseConfig);
|
|
28
31
|
const {
|
|
29
32
|
prefix,
|
|
30
33
|
magentoDir,
|
|
@@ -48,56 +51,65 @@ module.exports = async (ctx, overridenConfiguration, baseConfig) => {
|
|
|
48
51
|
elasticsearch: {
|
|
49
52
|
name: `${ prefix }_elasticsearch-data`
|
|
50
53
|
},
|
|
51
|
-
|
|
52
|
-
name:
|
|
54
|
+
maildev: {
|
|
55
|
+
name: `${ prefix }_maildev-data`
|
|
56
|
+
},
|
|
57
|
+
composer_cache: {
|
|
58
|
+
name: 'composer_cache-data',
|
|
59
|
+
opts: {
|
|
60
|
+
mode: 'z'
|
|
61
|
+
}
|
|
53
62
|
}
|
|
54
63
|
};
|
|
55
64
|
|
|
56
|
-
const
|
|
57
|
-
const { isWsl } = ctx;
|
|
58
|
-
const isNotNativeLinux = (!isLinux || isWsl);
|
|
65
|
+
const { isDockerDesktop } = ctx;
|
|
59
66
|
|
|
60
|
-
if (
|
|
67
|
+
if (isDockerDesktop) {
|
|
61
68
|
/**
|
|
62
|
-
* When CMA is running
|
|
63
|
-
* we need
|
|
69
|
+
* When CMA is running with Docker Desktop,
|
|
70
|
+
* we need create named volumes to avoid performance penalty
|
|
64
71
|
*/
|
|
65
72
|
volumes.php = {
|
|
66
73
|
name: `${ prefix }_project-data`,
|
|
74
|
+
driver: 'local',
|
|
67
75
|
opt: {
|
|
68
|
-
type: '
|
|
76
|
+
type: 'none',
|
|
69
77
|
device: path.join(magentoDir),
|
|
70
78
|
o: 'bind'
|
|
71
79
|
}
|
|
72
80
|
};
|
|
73
81
|
volumes.nginx = {
|
|
74
82
|
name: `${ prefix }_nginx-data`,
|
|
83
|
+
driver: 'local',
|
|
75
84
|
opt: {
|
|
76
|
-
type: '
|
|
85
|
+
type: 'none',
|
|
77
86
|
device: path.join(cacheDir, 'nginx', 'conf.d'),
|
|
78
87
|
o: 'bind'
|
|
79
88
|
}
|
|
80
89
|
};
|
|
81
90
|
volumes.appPub = {
|
|
82
91
|
name: `${ prefix }_pub-data`,
|
|
92
|
+
driver: 'local',
|
|
83
93
|
opt: {
|
|
84
|
-
type: '
|
|
94
|
+
type: 'none',
|
|
85
95
|
device: path.join(magentoDir, 'pub'),
|
|
86
96
|
o: 'bind'
|
|
87
97
|
}
|
|
88
98
|
};
|
|
89
99
|
volumes.appSetup = {
|
|
90
100
|
name: `${ prefix }_setup-data`,
|
|
101
|
+
driver: 'local',
|
|
91
102
|
opt: {
|
|
92
|
-
type: '
|
|
103
|
+
type: 'none',
|
|
93
104
|
device: path.join(magentoDir, 'setup'),
|
|
94
105
|
o: 'bind'
|
|
95
106
|
}
|
|
96
107
|
};
|
|
97
108
|
volumes.sslTerminator = {
|
|
98
109
|
name: `${ prefix }_ssl-terminator-data`,
|
|
110
|
+
driver: 'local',
|
|
99
111
|
opt: {
|
|
100
|
-
type: '
|
|
112
|
+
type: 'none',
|
|
101
113
|
device: path.join(cacheDir, 'ssl-terminator', 'conf.d'),
|
|
102
114
|
o: 'bind'
|
|
103
115
|
}
|
|
@@ -106,8 +118,9 @@ module.exports = async (ctx, overridenConfiguration, baseConfig) => {
|
|
|
106
118
|
if (varnish.enabled) {
|
|
107
119
|
volumes.varnish = {
|
|
108
120
|
name: `${ prefix }_varnish-data`,
|
|
121
|
+
driver: 'local',
|
|
109
122
|
opt: {
|
|
110
|
-
type: '
|
|
123
|
+
type: 'none',
|
|
111
124
|
device: path.join(cacheDir, 'varnish'),
|
|
112
125
|
o: 'bind'
|
|
113
126
|
}
|
|
@@ -122,24 +135,23 @@ module.exports = async (ctx, overridenConfiguration, baseConfig) => {
|
|
|
122
135
|
const dockerConfig = {
|
|
123
136
|
php: {
|
|
124
137
|
_: 'PHP',
|
|
125
|
-
ports:
|
|
138
|
+
ports: isDockerDesktop ? [
|
|
126
139
|
`${ isIpAddress(host) ? host : '127.0.0.1' }:${ ports.fpm }:9000`
|
|
127
140
|
] : [],
|
|
128
141
|
forwardedPorts: [
|
|
129
|
-
|
|
142
|
+
isDockerDesktop
|
|
130
143
|
? `127.0.0.1:${ ports.fpm }:9000`
|
|
131
144
|
: `127.0.0.1:${ ports.fpm }`
|
|
132
145
|
],
|
|
133
|
-
network:
|
|
146
|
+
network: isDockerDesktop ? network.name : 'host',
|
|
134
147
|
mountVolumes: [
|
|
135
|
-
`${
|
|
136
|
-
`${ volumes.
|
|
148
|
+
`${ !isDockerDesktop ? magentoDir : volumes.php.name }:${containerMagentoDir}`,
|
|
149
|
+
`${ volumes.composer_cache.name }:/composer/home/cache`,
|
|
137
150
|
`${ php.iniPath }:/usr/local/etc/php/php.ini`,
|
|
138
151
|
`${ php.fpmConfPath }:/usr/local/etc/php-fpm.d/zz-docker.conf`
|
|
139
|
-
],
|
|
152
|
+
].concat(ctx.debug ? [`${ php.debugIniPath }:/usr/local/etc/php/conf.d/00-xdebug.ini`] : []),
|
|
140
153
|
env: {
|
|
141
|
-
COMPOSER_AUTH: JSON.stringify(JSON.parse(process.env.COMPOSER_AUTH), null, 0) || ''
|
|
142
|
-
COMPOSER_HOME: '/composer/home'
|
|
154
|
+
COMPOSER_AUTH: JSON.stringify(JSON.parse(process.env.COMPOSER_AUTH), null, 0) || ''
|
|
143
155
|
},
|
|
144
156
|
restart: 'on-failure:5',
|
|
145
157
|
image: `local-cma-project:${ prefix }`,
|
|
@@ -150,15 +162,15 @@ module.exports = async (ctx, overridenConfiguration, baseConfig) => {
|
|
|
150
162
|
],
|
|
151
163
|
name: `${ prefix }_php`,
|
|
152
164
|
connectCommand: ['/bin/sh'],
|
|
153
|
-
user:
|
|
165
|
+
user: ((ctx.platform === 'linux' && isDockerDesktop) || !isDockerDesktop) ? `${os.userInfo().uid}:${os.userInfo().gid}` : ''
|
|
154
166
|
},
|
|
155
167
|
sslTerminator: {
|
|
156
168
|
_: 'SSL Terminator (Nginx)',
|
|
157
|
-
ports:
|
|
169
|
+
ports: isDockerDesktop ? [
|
|
158
170
|
`${ isIpAddress(host) ? host : '127.0.0.1' }:${ ports.sslTerminator }:80`
|
|
159
171
|
] : [],
|
|
160
172
|
forwardedPorts: [
|
|
161
|
-
|
|
173
|
+
isDockerDesktop
|
|
162
174
|
? `127.0.0.1:${ ports.sslTerminator }:80`
|
|
163
175
|
: `127.0.0.1:${ ports.sslTerminator }`
|
|
164
176
|
],
|
|
@@ -169,21 +181,22 @@ module.exports = async (ctx, overridenConfiguration, baseConfig) => {
|
|
|
169
181
|
* Mount volumes directly on linux
|
|
170
182
|
*/
|
|
171
183
|
mountVolumes: [
|
|
172
|
-
`${
|
|
184
|
+
`${ !isDockerDesktop ? path.join(cacheDir, 'ssl-terminator', 'conf.d') : volumes.sslTerminator.name }:/etc/nginx/conf.d`,
|
|
185
|
+
`${ path.join(cacheDir, 'ssl-terminator', 'fastcgi_params') }:/etc/nginx/fastcgi_params`
|
|
173
186
|
],
|
|
174
187
|
restart: 'on-failure:5',
|
|
175
|
-
network:
|
|
188
|
+
network: isDockerDesktop ? network.name : 'host',
|
|
176
189
|
image: `${ nginx.version ? `nginx:${ nginx.version }` : nginx.image }`,
|
|
177
190
|
name: `${ prefix }_ssl-terminator`,
|
|
178
191
|
command: "nginx -g 'daemon off;'"
|
|
179
192
|
},
|
|
180
193
|
nginx: {
|
|
181
194
|
_: 'Nginx',
|
|
182
|
-
ports:
|
|
195
|
+
ports: isDockerDesktop ? [
|
|
183
196
|
`${ isIpAddress(host) ? host : '127.0.0.1' }:${ ports.app }:80`
|
|
184
197
|
] : [],
|
|
185
198
|
forwardedPorts: [
|
|
186
|
-
|
|
199
|
+
isDockerDesktop
|
|
187
200
|
? `127.0.0.1:${ ports.app }:80`
|
|
188
201
|
: `127.0.0.1:${ ports.app }`
|
|
189
202
|
],
|
|
@@ -193,18 +206,19 @@ module.exports = async (ctx, overridenConfiguration, baseConfig) => {
|
|
|
193
206
|
/**
|
|
194
207
|
* Mount volumes directly on linux
|
|
195
208
|
*/
|
|
196
|
-
mountVolumes:
|
|
209
|
+
mountVolumes: !isDockerDesktop ? [
|
|
197
210
|
`${ cacheDir }/nginx/conf.d:/etc/nginx/conf.d`,
|
|
198
211
|
`${ path.join(magentoDir, 'pub') }:${path.join(containerMagentoDir, 'pub')}`,
|
|
199
|
-
`${ path.join(magentoDir, 'setup') }:${path.join(containerMagentoDir, 'setup')}
|
|
212
|
+
`${ path.join(magentoDir, 'setup') }:${path.join(containerMagentoDir, 'setup')}`,
|
|
213
|
+
`${ path.join(cacheDir, 'ssl-terminator', 'fastcgi_params') }:/etc/nginx/fastcgi_params`
|
|
200
214
|
] : [
|
|
201
215
|
`${ volumes.nginx.name }:/etc/nginx/conf.d`,
|
|
202
216
|
`${ volumes.appPub.name }:${path.join(containerMagentoDir, 'pub')}`,
|
|
203
|
-
`${ volumes.appSetup.name }:${path.join(containerMagentoDir, 'setup')}
|
|
217
|
+
`${ volumes.appSetup.name }:${path.join(containerMagentoDir, 'setup')}`,
|
|
218
|
+
`${ path.join(cacheDir, 'ssl-terminator', 'fastcgi_params') }:/etc/nginx/fastcgi_params`
|
|
204
219
|
],
|
|
205
220
|
restart: 'on-failure:5',
|
|
206
|
-
|
|
207
|
-
network: isNotNativeLinux ? network.name : 'host',
|
|
221
|
+
network: isDockerDesktop ? network.name : 'host',
|
|
208
222
|
image: `${ nginx.version ? `nginx:${ nginx.version }` : nginx.image }`,
|
|
209
223
|
name: `${ prefix }_nginx`,
|
|
210
224
|
command: "nginx -g 'daemon off;'"
|
|
@@ -217,7 +231,6 @@ module.exports = async (ctx, overridenConfiguration, baseConfig) => {
|
|
|
217
231
|
ports: [`127.0.0.1:${ ports.redis }:6379`],
|
|
218
232
|
forwardedPorts: [`127.0.0.1:${ ports.redis }:6379`],
|
|
219
233
|
mounts: [`source=${ volumes.redis.name },target=/data`],
|
|
220
|
-
// TODO: use connect instead
|
|
221
234
|
network: network.name,
|
|
222
235
|
image: `${ redis.version ? `redis:${ redis.version }` : redis.image }`,
|
|
223
236
|
name: `${ prefix }_redis`,
|
|
@@ -235,22 +248,18 @@ module.exports = async (ctx, overridenConfiguration, baseConfig) => {
|
|
|
235
248
|
`${ path.join(baseConfig.cacheDir, 'mariadb.cnf') }:/etc/mysql/my.cnf`
|
|
236
249
|
],
|
|
237
250
|
env: {
|
|
238
|
-
|
|
239
|
-
MARIADB_ROOT_PASSWORD: 'scandipwa',
|
|
240
|
-
MARIADB_USER: 'magento',
|
|
241
|
-
MARIADB_PASSWORD: 'magento',
|
|
242
|
-
MARIADB_DATABASE: 'magento'
|
|
251
|
+
MARIADB_ROOT_PASSWORD: 'scandipwa'
|
|
243
252
|
},
|
|
244
|
-
command:
|
|
245
|
-
'--log_bin_trust_function_creators=1'
|
|
246
|
-
]
|
|
247
|
-
.join(' '),
|
|
253
|
+
command: '--log_bin_trust_function_creators=1',
|
|
248
254
|
securityOptions: [
|
|
249
255
|
'seccomp=unconfined'
|
|
250
256
|
],
|
|
251
257
|
network: network.name,
|
|
252
258
|
image: `${ mariadb.version ? `mariadb:${ mariadb.version }` : mariadb.image }`,
|
|
253
|
-
name: `${ prefix }_mariadb
|
|
259
|
+
name: `${ prefix }_mariadb`,
|
|
260
|
+
description: `To connect to MariaDB you can use the following users:
|
|
261
|
+
- User ${ logger.style.command('root') } with password ${ logger.style.command('scandipwa') }
|
|
262
|
+
- User ${ logger.style.command(defaultMagentoUser.user) } with password ${ logger.style.command(defaultMagentoUser.password) }`
|
|
254
263
|
},
|
|
255
264
|
elasticsearch: {
|
|
256
265
|
_: 'ElasticSearch',
|
|
@@ -269,10 +278,40 @@ module.exports = async (ctx, overridenConfiguration, baseConfig) => {
|
|
|
269
278
|
network: network.name,
|
|
270
279
|
image: `${ elasticsearch.version ? `elasticsearch:${ elasticsearch.version }` : elasticsearch.image }`,
|
|
271
280
|
name: `${ prefix }_elasticsearch`
|
|
281
|
+
},
|
|
282
|
+
maildev: {
|
|
283
|
+
_: 'MailDev',
|
|
284
|
+
ports: isDockerDesktop ? [
|
|
285
|
+
`127.0.0.1:${ ports.maildevWeb }:1080`,
|
|
286
|
+
`127.0.0.1:${ ports.maildevSMTP }:1025`
|
|
287
|
+
] : [],
|
|
288
|
+
forwardedPorts: isDockerDesktop ? [
|
|
289
|
+
`127.0.0.1:${ ports.maildevWeb }:1080`,
|
|
290
|
+
`127.0.0.1:${ ports.maildevSMTP }:1025`
|
|
291
|
+
] : [
|
|
292
|
+
`127.0.0.1:${ ports.maildevWeb }`,
|
|
293
|
+
`127.0.0.1:${ ports.maildevSMTP }`
|
|
294
|
+
],
|
|
295
|
+
mountVolumes: [
|
|
296
|
+
`${ volumes.maildev.name }:/tmp/maildev`
|
|
297
|
+
],
|
|
298
|
+
env: {
|
|
299
|
+
MAILDEV_SMTP_PORT: isDockerDesktop ? '1025' : ports.maildevSMTP,
|
|
300
|
+
MAILDEV_WEB_PORT: isDockerDesktop ? '1080' : ports.maildevWeb,
|
|
301
|
+
MAILDEV_MAIL_DIRECTORY: '/tmp/maildev'
|
|
302
|
+
},
|
|
303
|
+
name: `${ prefix }_maildev`,
|
|
304
|
+
network: isDockerDesktop ? network.name : 'host',
|
|
305
|
+
image: maildev.image,
|
|
306
|
+
user: !isDockerDesktop ? 'root:root' : '',
|
|
307
|
+
connectCommand: ['/bin/sh'],
|
|
308
|
+
healthCheck: {
|
|
309
|
+
cmd: `wget -O - http://127.0.0.1:${ isDockerDesktop ? '1080' : ports.maildevWeb }/healthz || exit 1`
|
|
310
|
+
}
|
|
272
311
|
}
|
|
273
312
|
};
|
|
274
313
|
|
|
275
|
-
if (ssl.enabled) {
|
|
314
|
+
if (ssl.enabled && isDockerDesktop) {
|
|
276
315
|
dockerConfig.sslTerminator.ports.push(
|
|
277
316
|
`${isIpAddress(host) ? host : '127.0.0.1'}:443:443`
|
|
278
317
|
);
|
|
@@ -284,13 +323,13 @@ module.exports = async (ctx, overridenConfiguration, baseConfig) => {
|
|
|
284
323
|
image: `${ varnish.version ? `varnish:${ varnish.version }` : varnish.image }`,
|
|
285
324
|
name: `${ prefix }_varnish`,
|
|
286
325
|
mountVolumes: [
|
|
287
|
-
`${
|
|
326
|
+
`${ !isDockerDesktop ? path.join(cacheDir, 'varnish') : volumes.varnish.name }:/etc/varnish`
|
|
288
327
|
],
|
|
289
|
-
ports:
|
|
328
|
+
ports: isDockerDesktop ? [
|
|
290
329
|
`${ isIpAddress(host) ? host : '127.0.0.1' }:${ ports.varnish }:80`
|
|
291
330
|
] : [],
|
|
292
331
|
forwardedPorts: [
|
|
293
|
-
|
|
332
|
+
isDockerDesktop
|
|
294
333
|
? `127.0.0.1:${ ports.varnish }:80`
|
|
295
334
|
: `127.0.0.1:${ ports.varnish }`
|
|
296
335
|
],
|
|
@@ -298,12 +337,13 @@ module.exports = async (ctx, overridenConfiguration, baseConfig) => {
|
|
|
298
337
|
VARNISH_SIZE: '2G'
|
|
299
338
|
},
|
|
300
339
|
restart: 'on-failure:30',
|
|
301
|
-
network:
|
|
340
|
+
network: isDockerDesktop ? network.name : 'host',
|
|
302
341
|
// eslint-disable-next-line max-len
|
|
303
|
-
command: `/bin/bash -c "varnishd -a :${
|
|
342
|
+
command: `/bin/bash -c "varnishd -a :${ isDockerDesktop ? 80 : ports.varnish } -t 600 -f /etc/varnish/default.vcl -s Cache=malloc,2048m -s Transient=malloc,512m -p http_resp_hdr_len=70000 -p http_resp_size=100000 && varnishlog"`,
|
|
304
343
|
tmpfs: [
|
|
305
344
|
'/var/lib/varnish:exec'
|
|
306
|
-
]
|
|
345
|
+
],
|
|
346
|
+
description: `Varnish HealthCheck status: ${ logger.style.command(varnish.healthCheck ? 'enabled' : 'disabled') }`
|
|
307
347
|
};
|
|
308
348
|
}
|
|
309
349
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
const { getProjectConfig } = require('./config');
|
|
1
2
|
const { getConfigFromMagentoVersion } = require('./index');
|
|
2
3
|
|
|
3
4
|
/**
|
|
@@ -8,6 +9,10 @@ const getProjectConfiguration = () => ({
|
|
|
8
9
|
task: async (ctx) => {
|
|
9
10
|
const { magentoVersion } = ctx;
|
|
10
11
|
|
|
12
|
+
if (typeof ctx.debug !== 'boolean') {
|
|
13
|
+
ctx.debug = getProjectConfig().debug;
|
|
14
|
+
}
|
|
15
|
+
|
|
11
16
|
ctx.config = await getConfigFromMagentoVersion(ctx, {
|
|
12
17
|
magentoVersion
|
|
13
18
|
});
|
package/lib/config/index.js
CHANGED
|
@@ -9,6 +9,7 @@ const { getMagentoConfig } = require('./magento-config');
|
|
|
9
9
|
const resolveConfigurationWithOverrides = require('../util/resolve-configuration-with-overrides');
|
|
10
10
|
const { getPrefix, folderName } = require('../util/prefix');
|
|
11
11
|
const UnknownError = require('../errors/unknown-error');
|
|
12
|
+
const { getProjectConfig } = require('./config');
|
|
12
13
|
|
|
13
14
|
const platforms = ['linux', 'darwin'];
|
|
14
15
|
const darwinMinimalVersion = '10.5';
|
|
@@ -33,7 +34,11 @@ const magento = {
|
|
|
33
34
|
|
|
34
35
|
module.exports = {
|
|
35
36
|
/**
|
|
36
|
-
* @param {
|
|
37
|
+
* @param {import('../../typings/context')} ctx
|
|
38
|
+
* @param {Object} param1
|
|
39
|
+
* @param {String} [param1.magentoVersion]
|
|
40
|
+
* @param {String} [param1.projectPath]
|
|
41
|
+
* @param {String} [param1.prefix]
|
|
37
42
|
*/
|
|
38
43
|
async getConfigFromMagentoVersion(ctx, {
|
|
39
44
|
magentoVersion,
|
|
@@ -45,6 +50,7 @@ module.exports = {
|
|
|
45
50
|
if (!configurations[magentoVersion]) {
|
|
46
51
|
throw new UnknownError(`No config found for magento version ${magentoVersion}`);
|
|
47
52
|
}
|
|
53
|
+
const projectConfig = getProjectConfig();
|
|
48
54
|
|
|
49
55
|
const {
|
|
50
56
|
overridenConfiguration,
|
|
@@ -56,13 +62,14 @@ module.exports = {
|
|
|
56
62
|
);
|
|
57
63
|
|
|
58
64
|
return {
|
|
59
|
-
php: getPhpConfig(overridenConfiguration
|
|
65
|
+
php: getPhpConfig(overridenConfiguration, newBaseConfig),
|
|
60
66
|
docker: await getDockerConfig(ctx, overridenConfiguration, newBaseConfig),
|
|
61
67
|
magentoConfiguration: getMagentoConfig(overridenConfiguration.magento),
|
|
62
68
|
baseConfig: newBaseConfig,
|
|
63
69
|
overridenConfiguration,
|
|
64
70
|
userConfiguration,
|
|
65
|
-
nonOverridenConfiguration: configurations[magentoVersion]
|
|
71
|
+
nonOverridenConfiguration: configurations[magentoVersion],
|
|
72
|
+
projectConfig
|
|
66
73
|
};
|
|
67
74
|
},
|
|
68
75
|
baseConfig,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const magento23RequiredPHPExtensions = require('./magento-2.3');
|
|
2
2
|
const magento24RequiredPHPExtensions = require('./magento-2.4');
|
|
3
3
|
|
|
4
|
-
const { phpExtensionInstallationInstructions } = require('../../php/extensions');
|
|
4
|
+
const { phpExtensionInstallationInstructions } = require('../../services/php/extensions');
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* @param {string[]} requiredPHPExtensions
|
package/lib/config/php-config.js
CHANGED
|
@@ -5,17 +5,18 @@ const path = require('path');
|
|
|
5
5
|
* @param {import('../../typings/context').ListrContext['config']['baseConfig']} baseConfig
|
|
6
6
|
*/
|
|
7
7
|
module.exports = (overridenConfiguration, baseConfig) => {
|
|
8
|
-
const { php } = overridenConfiguration;
|
|
8
|
+
const { configuration: { php } } = overridenConfiguration;
|
|
9
9
|
|
|
10
10
|
const { cacheDir } = baseConfig;
|
|
11
11
|
|
|
12
12
|
const phpConfiguration = {
|
|
13
13
|
iniPath: path.join(cacheDir, 'php.ini'),
|
|
14
14
|
iniTemplatePath: php.configTemplate,
|
|
15
|
+
debugIniPath: path.join(cacheDir, 'xdebug.ini'),
|
|
16
|
+
debugTemplatePath: php.debugTemplate,
|
|
15
17
|
fpmTemplatePath: php.fpmConfigTemplate,
|
|
16
18
|
fpmConfPath: path.join(cacheDir, 'php-fpm.conf'),
|
|
17
|
-
extensions: php.extensions
|
|
18
|
-
version: php.version
|
|
19
|
+
extensions: php.extensions
|
|
19
20
|
};
|
|
20
21
|
|
|
21
22
|
return phpConfiguration;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
const defaultEnv = require('../default-es-env');
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @returns {import('../../../../../typings/index').ServiceWithImage}
|
|
5
|
+
*/
|
|
6
|
+
const elasticsearch710 = () => ({
|
|
7
|
+
image: 'elasticsearch:7.10.1',
|
|
8
|
+
env: defaultEnv
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
module.exports = elasticsearch710;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
const defaultEnv = require('../default-es-env');
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @returns {import('../../../../../typings/index').ServiceWithImage}
|
|
5
|
+
*/
|
|
6
|
+
const elasticsearch712 = () => ({
|
|
7
|
+
image: 'elasticsearch:7.12.1',
|
|
8
|
+
env: defaultEnv
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
module.exports = elasticsearch712;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
const defaultEnv = require('../default-es-env');
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @returns {import('../../../../../typings/index').ServiceWithImage}
|
|
5
|
+
*/
|
|
6
|
+
const elasticsearch716 = () => ({
|
|
7
|
+
image: 'elasticsearch:7.16.3',
|
|
8
|
+
env: defaultEnv
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
module.exports = elasticsearch716;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
const defaultEnv = require('../default-es-env');
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @returns {import('../../../../../typings/index').ServiceWithImage}
|
|
5
|
+
*/
|
|
6
|
+
const elasticsearch717 = () => ({
|
|
7
|
+
image: 'elasticsearch:7.17.6',
|
|
8
|
+
env: defaultEnv
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
module.exports = elasticsearch717;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
const defaultEnv = require('../default-es-env');
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @returns {import('../../../../../typings/index').ServiceWithImage}
|
|
5
|
+
*/
|
|
6
|
+
const elasticsearch76 = () => ({
|
|
7
|
+
image: 'elasticsearch:7.6.2',
|
|
8
|
+
env: defaultEnv
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
module.exports = elasticsearch76;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
const defaultEnv = require('../default-es-env');
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @returns {import('../../../../../typings/index').ServiceWithImage}
|
|
5
|
+
*/
|
|
6
|
+
const elasticsearch77 = () => ({
|
|
7
|
+
image: 'elasticsearch:7.7.1',
|
|
8
|
+
env: defaultEnv
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
module.exports = elasticsearch77;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
const defaultEnv = require('../default-es-env');
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @returns {import('../../../../../typings/index').ServiceWithImage}
|
|
5
|
+
*/
|
|
6
|
+
const elasticsearch79 = () => ({
|
|
7
|
+
image: 'elasticsearch:7.9.3',
|
|
8
|
+
env: defaultEnv
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
module.exports = elasticsearch79;
|
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
const elasticsearch68 = require('./elasticsearch-6.8');
|
|
2
|
+
const elasticsearch76 = require('./elasticsearch-7.6');
|
|
3
|
+
const elasticsearch77 = require('./elasticsearch-7.7');
|
|
4
|
+
const elasticsearch79 = require('./elasticsearch-7.9');
|
|
5
|
+
const elasticsearch710 = require('./elasticsearch-7.10');
|
|
6
|
+
const elasticsearch712 = require('./elasticsearch-7.12');
|
|
7
|
+
const elasticsearch716 = require('./elasticsearch-7.16');
|
|
8
|
+
const elasticsearch717 = require('./elasticsearch-7.17');
|
|
2
9
|
|
|
3
10
|
module.exports = {
|
|
4
|
-
elasticsearch68
|
|
11
|
+
elasticsearch68,
|
|
12
|
+
elasticsearch76,
|
|
13
|
+
elasticsearch77,
|
|
14
|
+
elasticsearch79,
|
|
15
|
+
elasticsearch710,
|
|
16
|
+
elasticsearch712,
|
|
17
|
+
elasticsearch716,
|
|
18
|
+
elasticsearch717
|
|
5
19
|
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
const path = require('path');
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @returns {import('../../../../../typings/index').NginxConfiguration}
|
|
5
|
+
*/
|
|
6
|
+
const nginx118 = ({ templateDir }) => ({
|
|
7
|
+
version: '1.18.0',
|
|
8
|
+
configTemplate: path.join(templateDir || '', 'nginx.template.conf')
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
module.exports = nginx118;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|