@scandipwa/magento-scripts 2.3.7 → 2.4.0-alpha.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 (2) hide show
  1. package/lib/config/docker.js +45 -115
  2. package/package.json +2 -2
@@ -68,70 +68,6 @@ module.exports = async (ctx, overridenConfiguration, baseConfig) => {
68
68
 
69
69
  const { isDockerDesktop } = ctx
70
70
 
71
- if (isDockerDesktop) {
72
- /**
73
- * When CMA is running with Docker Desktop,
74
- * we need create named volumes to avoid performance penalty
75
- */
76
- volumes.php = {
77
- name: `${prefix}_project-data`,
78
- driver: 'local',
79
- opt: {
80
- type: 'none',
81
- device: path.join(magentoDir),
82
- o: 'bind'
83
- }
84
- }
85
- volumes.nginx = {
86
- name: `${prefix}_nginx-data`,
87
- driver: 'local',
88
- opt: {
89
- type: 'none',
90
- device: path.join(cacheDir, 'nginx', 'conf.d'),
91
- o: 'bind'
92
- }
93
- }
94
- volumes.appPub = {
95
- name: `${prefix}_pub-data`,
96
- driver: 'local',
97
- opt: {
98
- type: 'none',
99
- device: path.join(magentoDir, 'pub'),
100
- o: 'bind'
101
- }
102
- }
103
- volumes.appSetup = {
104
- name: `${prefix}_setup-data`,
105
- driver: 'local',
106
- opt: {
107
- type: 'none',
108
- device: path.join(magentoDir, 'setup'),
109
- o: 'bind'
110
- }
111
- }
112
- volumes.sslTerminator = {
113
- name: `${prefix}_ssl-terminator-data`,
114
- driver: 'local',
115
- opt: {
116
- type: 'none',
117
- device: path.join(cacheDir, 'ssl-terminator', 'conf.d'),
118
- o: 'bind'
119
- }
120
- }
121
-
122
- if (varnish.enabled) {
123
- volumes.varnish = {
124
- name: `${prefix}_varnish-data`,
125
- driver: 'local',
126
- opt: {
127
- type: 'none',
128
- device: path.join(cacheDir, 'varnish'),
129
- o: 'bind'
130
- }
131
- }
132
- }
133
- }
134
-
135
71
  /**
136
72
  * @param {Record<string, number>} ports
137
73
  */
@@ -166,16 +102,26 @@ module.exports = async (ctx, overridenConfiguration, baseConfig) => {
166
102
  ],
167
103
  network: isDockerDesktop ? network.name : 'host',
168
104
  mountVolumes: [
169
- `${
170
- !isDockerDesktop ? magentoDir : volumes.php.name
171
- }:${containerMagentoDir}`,
105
+ `${magentoDir}:${containerMagentoDir}${
106
+ isDockerDesktop ? ':cached' : ''
107
+ }`,
172
108
  `${volumes.composer_cache.name}:/composer/home/cache`,
173
- `${php.iniPath}:/usr/local/etc/php/php.ini`,
174
- `${php.fpmConfPath}:/usr/local/etc/php-fpm.d/zz-docker.conf`
109
+ `${php.iniPath}:/usr/local/etc/php/php.ini${
110
+ isDockerDesktop ? ':cached' : ''
111
+ }`,
112
+ `${
113
+ php.fpmConfPath
114
+ }:/usr/local/etc/php-fpm.d/zz-docker.conf${
115
+ isDockerDesktop ? ':cached' : ''
116
+ }`
175
117
  ].concat(
176
118
  ctx.debug
177
119
  ? [
178
- `${php.debugIniPath}:/usr/local/etc/php/conf.d/00-xdebug.ini`
120
+ `${
121
+ php.debugIniPath
122
+ }:/usr/local/etc/php/conf.d/00-xdebug.ini${
123
+ isDockerDesktop ? ':cached' : ''
124
+ }`
179
125
  ]
180
126
  : []
181
127
  ),
@@ -216,16 +162,18 @@ module.exports = async (ctx, overridenConfiguration, baseConfig) => {
216
162
  * Mount volumes directly on linux
217
163
  */
218
164
  mountVolumes: [
219
- `${
220
- !isDockerDesktop
221
- ? path.join(cacheDir, 'ssl-terminator', 'conf.d')
222
- : volumes.sslTerminator.name
223
- }:/etc/nginx/conf.d`,
165
+ `${path.join(
166
+ cacheDir,
167
+ 'ssl-terminator',
168
+ 'conf.d'
169
+ )}:/etc/nginx/conf.d${isDockerDesktop ? ':cached' : ''}`,
224
170
  `${path.join(
225
171
  cacheDir,
226
172
  'ssl-terminator',
227
173
  'fastcgi_params'
228
- )}:/etc/nginx/fastcgi_params`
174
+ )}:/etc/nginx/fastcgi_params${
175
+ isDockerDesktop ? ':cached' : ''
176
+ }`
229
177
  ],
230
178
  restart: 'on-failure:5',
231
179
  network: isDockerDesktop ? network.name : 'host',
@@ -255,39 +203,23 @@ module.exports = async (ctx, overridenConfiguration, baseConfig) => {
255
203
  /**
256
204
  * Mount volumes directly on linux
257
205
  */
258
- mountVolumes: !isDockerDesktop
259
- ? [
260
- `${cacheDir}/nginx/conf.d:/etc/nginx/conf.d`,
261
- `${path.join(magentoDir, 'pub')}:${path.join(
262
- containerMagentoDir,
263
- 'pub'
264
- )}`,
265
- `${path.join(magentoDir, 'setup')}:${path.join(
266
- containerMagentoDir,
267
- 'setup'
268
- )}`,
269
- `${path.join(
270
- cacheDir,
271
- 'ssl-terminator',
272
- 'fastcgi_params'
273
- )}:/etc/nginx/fastcgi_params`
274
- ]
275
- : [
276
- `${volumes.nginx.name}:/etc/nginx/conf.d`,
277
- `${volumes.appPub.name}:${path.join(
278
- containerMagentoDir,
279
- 'pub'
280
- )}`,
281
- `${volumes.appSetup.name}:${path.join(
282
- containerMagentoDir,
283
- 'setup'
284
- )}`,
285
- `${path.join(
286
- cacheDir,
287
- 'ssl-terminator',
288
- 'fastcgi_params'
289
- )}:/etc/nginx/fastcgi_params`
290
- ],
206
+ mountVolumes: [
207
+ `${path.join(
208
+ cacheDir,
209
+ 'nginx',
210
+ 'conf.d'
211
+ )}:/etc/nginx/conf.d${isDockerDesktop ? ':cached' : ''}`,
212
+ `${magentoDir}:${containerMagentoDir}${
213
+ isDockerDesktop ? ':cached' : ''
214
+ }`,
215
+ `${path.join(
216
+ cacheDir,
217
+ 'ssl-terminator',
218
+ 'fastcgi_params'
219
+ )}:/etc/nginx/fastcgi_params${
220
+ isDockerDesktop ? ':cached' : ''
221
+ }`
222
+ ],
291
223
  restart: 'on-failure:5',
292
224
  network: isDockerDesktop ? network.name : 'host',
293
225
  image: `${
@@ -323,7 +255,7 @@ module.exports = async (ctx, overridenConfiguration, baseConfig) => {
323
255
  `${path.join(
324
256
  baseConfig.cacheDir,
325
257
  'mariadb.cnf'
326
- )}:/etc/mysql/my.cnf`
258
+ )}:/etc/mysql/my.cnf${isDockerDesktop ? ':cached' : ''}`
327
259
  ],
328
260
  env: {
329
261
  MARIADB_ROOT_PASSWORD: 'scandipwa'
@@ -444,11 +376,9 @@ module.exports = async (ctx, overridenConfiguration, baseConfig) => {
444
376
  }`,
445
377
  name: `${prefix}_varnish`,
446
378
  mountVolumes: [
447
- `${
448
- !isDockerDesktop
449
- ? path.join(cacheDir, 'varnish')
450
- : volumes.varnish.name
451
- }:/etc/varnish`
379
+ `${path.join(cacheDir, 'varnish')}:/etc/varnish${
380
+ isDockerDesktop ? ':cached' : ''
381
+ }`
452
382
  ],
453
383
  ports: isDockerDesktop
454
384
  ? [
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Scripts and configuration used by CMA.",
4
4
  "homepage": "https://docs.create-magento-app.com/",
5
5
  "repository": "github:scandipwa/create-magento-app",
6
- "version": "2.3.7",
6
+ "version": "2.4.0-alpha.0",
7
7
  "main": "./index.js",
8
8
  "types": "./typings/index.d.ts",
9
9
  "license": "OSL-3.0",
@@ -59,5 +59,5 @@
59
59
  "@types/node": "^20.10.4",
60
60
  "@types/yargs": "^17.0.13"
61
61
  },
62
- "gitHead": "0c65c7b45ec7a4028e9cdf07ccf2195e94a531a3"
62
+ "gitHead": "684832cd42a2a9b37bcb4a03a4196221e3802a74"
63
63
  }