@fishawack/lab-env 5.1.0 → 5.2.0-beta.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.
Files changed (46) hide show
  1. package/CHANGELOG.md +43 -0
  2. package/_Test/key.js +7 -2
  3. package/_Test/provision.js +9 -19
  4. package/_Test/s3.js +10 -6
  5. package/adonis/0/docker-compose.yml +2 -0
  6. package/adonis/0/nginx/CHANGELOG.md +3 -0
  7. package/adonis/0/nginx/nginx.conf +5 -1
  8. package/adonis/0/nginx/package.json +2 -2
  9. package/bitbucket-pipelines.yml +1 -1
  10. package/cli.js +1 -1
  11. package/commands/content.js +36 -25
  12. package/commands/create/cmds/deprovision.js +10 -2
  13. package/commands/create/cmds/provision.js +13 -2
  14. package/commands/create/libs/prompts.js +9 -0
  15. package/commands/create/libs/vars.js +67 -35
  16. package/commands/create/services/aws/cloudfront.js +17 -20
  17. package/commands/create/services/aws/ec2.js +2 -3
  18. package/commands/create/services/aws/elasticbeanstalk.js +11 -14
  19. package/commands/create/services/aws/iam.js +123 -65
  20. package/commands/create/services/aws/index.js +35 -35
  21. package/commands/create/services/aws/misc.js +6 -7
  22. package/commands/create/services/aws/s3.js +16 -16
  23. package/commands/create/templates/elasticbeanstalk/.ebextensions/misc/asg-self-healing.config +6 -0
  24. package/commands/create/templates/elasticbeanstalk/.ebextensions/misc/health-ignore-4xx.config +4 -0
  25. package/commands/test.js +11 -11
  26. package/core/0/package.json +1 -1
  27. package/craftcms/3/apache/package.json +1 -1
  28. package/craftcms/3/php/package.json +1 -1
  29. package/drupal/9/apache/package.json +1 -1
  30. package/drupal/9/php/package.json +1 -1
  31. package/globals.js +15 -0
  32. package/laravel/10/docker-compose.yml +2 -0
  33. package/laravel/8/docker-compose.yml +2 -0
  34. package/laravel/8/nginx/CHANGELOG.md +3 -0
  35. package/laravel/8/nginx/nginx.conf +5 -1
  36. package/laravel/8/nginx/package.json +2 -2
  37. package/laravel/8/php/package.json +1 -1
  38. package/laravel/9/docker-compose.yml +2 -0
  39. package/package.json +1 -1
  40. package/php/8.2/package.json +1 -1
  41. package/python/0/Dockerfile +8 -0
  42. package/python/0/docker-compose.yml +4 -1
  43. package/python/0/package.json +11 -0
  44. package/wordpress/0/package.json +1 -1
  45. package/wordpress/1/apache/package.json +1 -1
  46. package/wordpress/1/php/package.json +1 -1
@@ -62,23 +62,20 @@ module.exports.clients = [
62
62
 
63
63
  module.exports.static = async (
64
64
  name,
65
- account,
66
65
  tags = [],
67
66
  credentials = [],
68
67
  repo,
69
68
  branch,
70
69
  ) => {
71
- let s3 = await module.exports.s3.createS3Bucket(name, account, tags);
70
+ let s3 = await module.exports.s3.createS3Bucket(name, tags);
72
71
 
73
72
  let cloudfront =
74
73
  await module.exports.cloudfront.createCloudFrontDistribution(
75
74
  name,
76
- account,
77
75
  tags,
78
76
  (
79
77
  await module.exports.cloudfront.createCloudFrontFunction(
80
78
  name,
81
- account,
82
79
  credentials.length
83
80
  ? "aws-cloudfront-auth"
84
81
  : "aws-cloudfront-simple",
@@ -92,8 +89,11 @@ module.exports.static = async (
92
89
  ).FunctionSummary.FunctionMetadata.FunctionARN,
93
90
  (
94
91
  await module.exports.cloudfront.createCloudFrontFunction(
95
- module.exports.slug(`${repo}-response`, account, branch),
96
- account,
92
+ module.exports.slug(
93
+ `${repo}-response`,
94
+ process.env.AWS_PROFILE,
95
+ branch,
96
+ ),
97
97
  "aws-cloudfront-response",
98
98
  {},
99
99
  )
@@ -102,7 +102,6 @@ module.exports.static = async (
102
102
 
103
103
  await module.exports.s3.setS3BucketPolicy(
104
104
  name,
105
- account,
106
105
  cloudfront.Distribution.DistributionConfig.Origins.Items[0].S3OriginConfig.OriginAccessIdentity.split(
107
106
  "origin-access-identity/cloudfront/",
108
107
  )[1],
@@ -117,38 +116,34 @@ module.exports.static = async (
117
116
  return config;
118
117
  };
119
118
 
120
- module.exports.staticTerminate = async (name, account, repo, branch, id) => {
119
+ module.exports.staticTerminate = async (name, repo, branch, id) => {
121
120
  try {
122
- await module.exports.s3.emptyS3Bucket(name, account);
121
+ await module.exports.s3.emptyS3Bucket(name);
123
122
  } catch {
124
123
  /* empty */
125
124
  }
126
125
 
127
126
  try {
128
- await module.exports.s3.removeS3Bucket(name, account);
127
+ await module.exports.s3.removeS3Bucket(name);
129
128
  } catch {
130
129
  /* empty */
131
130
  }
132
131
 
133
132
  try {
134
- await module.exports.cloudfront.removeCloudFrontDistribution(
135
- id,
136
- account,
137
- );
133
+ await module.exports.cloudfront.removeCloudFrontDistribution(id);
138
134
  } catch {
139
135
  /* empty */
140
136
  }
141
137
 
142
138
  try {
143
- await module.exports.cloudfront.removeCloudFrontFunction(name, account);
139
+ await module.exports.cloudfront.removeCloudFrontFunction(name);
144
140
  } catch {
145
141
  /* empty */
146
142
  }
147
143
 
148
144
  try {
149
145
  await module.exports.cloudfront.removeCloudFrontFunction(
150
- module.exports.slug(`${repo}-response`, account, branch),
151
- account,
146
+ module.exports.slug(`${repo}-response`, branch),
152
147
  );
153
148
  } catch {
154
149
  /* empty */
@@ -157,43 +152,46 @@ module.exports.staticTerminate = async (name, account, repo, branch, id) => {
157
152
 
158
153
  module.exports.fullstack = async (
159
154
  name,
160
- account,
161
155
  tags = [],
162
156
  credentials = [],
163
157
  repo,
164
158
  branch,
165
159
  framework,
166
160
  availability,
161
+ database = false,
167
162
  ) => {
168
163
  const { platform, language } = eb.configurations[framework];
169
164
 
170
- const s3Slug = module.exports.slug(repo, account, branch, "s3");
165
+ const s3Slug = module.exports.slug(
166
+ repo,
167
+ process.env.AWS_PROFILE,
168
+ branch,
169
+ "s3",
170
+ );
171
171
 
172
- await module.exports.iam.createIAMUser(s3Slug, account, tags);
172
+ await module.exports.iam.createIAMUser(s3Slug, tags);
173
173
  await module.exports.iam.attachIAMPolicy(
174
174
  s3Slug,
175
- account,
176
175
  "arn:aws:iam::aws:policy/AmazonS3FullAccess",
177
176
  );
178
177
  const {
179
178
  AccessKey: { AccessKeyId },
180
179
  AccessKey: { SecretAccessKey },
181
- } = await module.exports.iam.createAccessKey(s3Slug, account);
180
+ } = await module.exports.iam.createAccessKey(s3Slug);
182
181
 
183
182
  await module.exports.s3.createS3Bucket(
184
183
  s3Slug,
185
- account,
186
184
  tags,
187
185
  false,
188
186
  "BucketOwnerPreferred",
189
187
  );
190
188
 
191
- await module.exports.iam.ensureEBInstanceProfileExists(account);
189
+ await module.exports.iam.ensureEBInstanceProfileExists();
190
+ await module.exports.iam.ensureEBManagedUpdateProfileExists();
192
191
 
193
192
  try {
194
193
  await module.exports.elasticbeanstalk.createElasticBeanstalkApplication(
195
194
  repo,
196
- account,
197
195
  );
198
196
  } catch {
199
197
  /* empty */
@@ -202,7 +200,7 @@ module.exports.fullstack = async (
202
200
  let hasKeyPair = false;
203
201
 
204
202
  try {
205
- await module.exports.ec2.getKeyPair("id_rsa_prev", account);
203
+ await module.exports.ec2.getKeyPair("id_rsa_prev");
206
204
  hasKeyPair = true;
207
205
  } catch {
208
206
  /* empty */
@@ -214,7 +212,7 @@ module.exports.fullstack = async (
214
212
 
215
213
  const OptionSettings = eb.merge(
216
214
  "environments",
217
- { framework, availability, platform, language },
215
+ { framework, availability, platform, language, database },
218
216
  { s3Slug, AccessKeyId, SecretAccessKey },
219
217
  );
220
218
 
@@ -229,7 +227,6 @@ module.exports.fullstack = async (
229
227
  const environment =
230
228
  await module.exports.elasticbeanstalk.createElasticBeanstalkEnvironment(
231
229
  name,
232
- account,
233
230
  { framework, availability, platform, language },
234
231
  repo,
235
232
  OptionSettings,
@@ -283,23 +280,28 @@ module.exports.fullstack = async (
283
280
  return config;
284
281
  };
285
282
 
286
- module.exports.fullstackTerminate = async (name, account, repo, branch) => {
287
- const s3Slug = module.exports.slug(repo, account, branch, "s3");
283
+ module.exports.fullstackTerminate = async (name, repo, branch) => {
284
+ const s3Slug = module.exports.slug(
285
+ repo,
286
+ process.env.AWS_PROFILE,
287
+ branch,
288
+ "s3",
289
+ );
288
290
 
289
291
  try {
290
- await module.exports.iam.removeIAMUser(s3Slug, account);
292
+ await module.exports.iam.removeIAMUser(s3Slug);
291
293
  } catch {
292
294
  /* empty */
293
295
  }
294
296
 
295
297
  try {
296
- await module.exports.s3.emptyS3Bucket(s3Slug, account);
298
+ await module.exports.s3.emptyS3Bucket(s3Slug);
297
299
  } catch {
298
300
  /* empty */
299
301
  }
300
302
 
301
303
  try {
302
- await module.exports.s3.removeS3Bucket(s3Slug, account);
304
+ await module.exports.s3.removeS3Bucket(s3Slug);
303
305
  } catch {
304
306
  /* empty */
305
307
  }
@@ -307,7 +309,6 @@ module.exports.fullstackTerminate = async (name, account, repo, branch) => {
307
309
  try {
308
310
  await module.exports.elasticbeanstalk.removeElasticBeanstalkEnvironment(
309
311
  name,
310
- account,
311
312
  );
312
313
  } catch {
313
314
  /* empty */
@@ -316,7 +317,6 @@ module.exports.fullstackTerminate = async (name, account, repo, branch) => {
316
317
  try {
317
318
  await module.exports.elasticbeanstalk.removeElasticBeanstalkApplication(
318
319
  repo,
319
- account,
320
320
  );
321
321
  } catch {
322
322
  /* empty */
@@ -1,11 +1,10 @@
1
- module.exports.createClient = (client, account, region = "us-east-1") => {
1
+ module.exports.setAWSClientDefaults = (
2
+ account = "fishawack",
3
+ region = "us-east-1",
4
+ ) => {
2
5
  delete process.env.AWS_PROFILE;
3
6
  delete process.env.AWS_REGION;
4
7
 
5
- if (account) {
6
- process.env.AWS_PROFILE = account;
7
- process.env.AWS_REGION = region;
8
- }
9
-
10
- return new client({ region });
8
+ process.env.AWS_PROFILE = account;
9
+ process.env.AWS_REGION = region;
11
10
  };
@@ -12,16 +12,14 @@ const {
12
12
  DeleteObjectsCommand,
13
13
  } = require("@aws-sdk/client-s3");
14
14
  const { Spinner } = require("../../libs/utilities");
15
- const { createClient } = require("./misc.js");
16
15
 
17
16
  module.exports.createS3Bucket = async (
18
17
  bucket,
19
- account,
20
18
  tags = [],
21
19
  blockAccess = true,
22
20
  ObjectOwnership = "BucketOwnerEnforced",
23
21
  ) => {
24
- const client = createClient(S3Client, account);
22
+ const client = new S3Client({});
25
23
 
26
24
  let res = await Spinner.prototype.simple(
27
25
  `Creating s3 bucket ${bucket}`,
@@ -54,7 +52,9 @@ module.exports.createS3Bucket = async (
54
52
  new PutBucketTaggingCommand({
55
53
  Bucket: bucket,
56
54
  Tagging: {
57
- TagSet: [{ Key: "client", Value: account }].concat(tags),
55
+ TagSet: [
56
+ { Key: "client", Value: process.env.AWS_PROFILE },
57
+ ].concat(tags),
58
58
  },
59
59
  }),
60
60
  );
@@ -63,8 +63,8 @@ module.exports.createS3Bucket = async (
63
63
  return res;
64
64
  };
65
65
 
66
- module.exports.listS3Buckets = async (account) => {
67
- const client = createClient(S3Client, account);
66
+ module.exports.listS3Buckets = async () => {
67
+ const client = new S3Client({});
68
68
 
69
69
  let res = await Spinner.prototype.simple(`Listing s3 buckets`, () => {
70
70
  return client.send(new ListBucketsCommand({}));
@@ -73,16 +73,16 @@ module.exports.listS3Buckets = async (account) => {
73
73
  return res;
74
74
  };
75
75
 
76
- module.exports.removeS3Bucket = async (bucket, account) => {
77
- const client = createClient(S3Client, account);
76
+ module.exports.removeS3Bucket = async (bucket) => {
77
+ const client = new S3Client({});
78
78
 
79
79
  await Spinner.prototype.simple(`Removing s3 bucket ${bucket}`, () => {
80
80
  return client.send(new DeleteBucketCommand({ Bucket: bucket }));
81
81
  });
82
82
  };
83
83
 
84
- module.exports.setS3BucketPolicy = async (bucket, account, OAI) => {
85
- const client = createClient(S3Client, account);
84
+ module.exports.setS3BucketPolicy = async (bucket, OAI) => {
85
+ const client = new S3Client({});
86
86
 
87
87
  let res = await Spinner.prototype.simple(
88
88
  `Updating s3 bucket policy`,
@@ -116,8 +116,8 @@ module.exports.setS3BucketPolicy = async (bucket, account, OAI) => {
116
116
  return res;
117
117
  };
118
118
 
119
- module.exports.addFileToS3Bucket = async (bucket, account, filepath, file) => {
120
- const client = createClient(S3Client, account);
119
+ module.exports.addFileToS3Bucket = async (bucket, filepath, file) => {
120
+ const client = new S3Client({});
121
121
 
122
122
  let res = await Spinner.prototype.simple(`Adding file to s3 bucket`, () => {
123
123
  return client.send(
@@ -132,8 +132,8 @@ module.exports.addFileToS3Bucket = async (bucket, account, filepath, file) => {
132
132
  return res;
133
133
  };
134
134
 
135
- module.exports.removeFileToS3Bucket = async (bucket, account, filepath) => {
136
- const client = createClient(S3Client, account);
135
+ module.exports.removeFileToS3Bucket = async (bucket, filepath) => {
136
+ const client = new S3Client({});
137
137
 
138
138
  let res = await Spinner.prototype.simple(
139
139
  `Removing file from s3 bucket`,
@@ -150,8 +150,8 @@ module.exports.removeFileToS3Bucket = async (bucket, account, filepath) => {
150
150
  return res;
151
151
  };
152
152
 
153
- module.exports.emptyS3Bucket = async (bucket, account) => {
154
- const client = createClient(S3Client, account);
153
+ module.exports.emptyS3Bucket = async (bucket) => {
154
+ const client = new S3Client({});
155
155
 
156
156
  await Spinner.prototype.simple(`Emptying s3 bucket`, () => {
157
157
  // eslint-disable-next-line no-async-promise-executor
@@ -0,0 +1,6 @@
1
+ Resources:
2
+ AWSEBAutoScalingGroup:
3
+ Type: "AWS::AutoScaling::AutoScalingGroup"
4
+ Properties:
5
+ HealthCheckType: ELB
6
+ HealthCheckGracePeriod: 300
@@ -0,0 +1,4 @@
1
+ option_settings:
2
+ - namespace: aws:elasticbeanstalk:healthreporting:system
3
+ option_name: ConfigDocument
4
+ value: '{"Version":1,"CloudWatchMetrics":{"Instance":{},"Environment":{}},"Rules":{"Environment":{"Application":{"ApplicationRequests4xx":{"Enabled":false}},"ELB":{"ELBRequests4xx":{"Enabled":false}}}}}'
package/commands/test.js CHANGED
@@ -6,21 +6,21 @@ module.exports = [
6
6
  () => {},
7
7
  () => {
8
8
  _.up(() => {
9
+ _.command(
10
+ "core",
11
+ `${process.env.VERSION === "0" ? "xvfb-run " : ""}npm run test`,
12
+ );
13
+
9
14
  if (_.platform === "python") {
10
15
  _.command("python", `uv run pytest -o log_cli=true`);
11
- } else {
12
- _.command(
13
- "core",
14
- `${process.env.VERSION === "0" ? "xvfb-run " : ""}npm run test`,
15
- );
16
+ }
16
17
 
17
- if (_.platform === "laravel") {
18
- _.command("php", `php artisan test`);
19
- }
18
+ if (_.platform === "laravel") {
19
+ _.command("php", `php artisan test`);
20
+ }
20
21
 
21
- if (_.platform === "adonis") {
22
- _.command("node", `node ace test`);
23
- }
22
+ if (_.platform === "adonis") {
23
+ _.command("node", `node ace test`);
24
24
  }
25
25
  });
26
26
  },
@@ -4,7 +4,7 @@
4
4
  "description": "lab-env docker config for the @fishawack/core npm module",
5
5
  "scripts": {
6
6
  "preversion": "docker login",
7
- "postversion": "docker build --platform linux/amd64 -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 \"build: Bumped core to $npm_package_version\""
7
+ "postversion": "docker build --platform linux/amd64 -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 \"build: bumped core to $npm_package_version\""
8
8
  },
9
9
  "author": "Mike Mellor",
10
10
  "license": "ISC"
@@ -4,7 +4,7 @@
4
4
  "description": "lab-env docker config for the apache module",
5
5
  "scripts": {
6
6
  "preversion": "docker login",
7
- "postversion": "docker buildx build --target development --platform linux/amd64,linux/arm64 -t fishawack/lab-env-craftcms-3-apache:$npm_package_version -t fishawack/lab-env-craftcms-3-apache:latest --push . && git add . && git commit -m \"build: Bumped fishawack/lab-env-craftcms-3-apache to $npm_package_version\""
7
+ "postversion": "docker buildx build --target development --platform linux/amd64,linux/arm64 -t fishawack/lab-env-craftcms-3-apache:$npm_package_version -t fishawack/lab-env-craftcms-3-apache:latest --push . && git add . && git commit -m \"build: bumped fishawack/lab-env-craftcms-3-apache to $npm_package_version\""
8
8
  },
9
9
  "author": "Mike Mellor",
10
10
  "license": "ISC"
@@ -4,7 +4,7 @@
4
4
  "description": "lab-env docker config for the php module",
5
5
  "scripts": {
6
6
  "preversion": "docker login",
7
- "postversion": "docker buildx build --target development --platform linux/amd64,linux/arm64 -t fishawack/lab-env-craftcms-3-php:$npm_package_version -t fishawack/lab-env-craftcms-3-php:latest --push . && git add . && git commit -m \"build: Bumped fishawack/lab-env-craftcms-3-php to $npm_package_version\""
7
+ "postversion": "docker buildx build --target development --platform linux/amd64,linux/arm64 -t fishawack/lab-env-craftcms-3-php:$npm_package_version -t fishawack/lab-env-craftcms-3-php:latest --push . && git add . && git commit -m \"build: bumped fishawack/lab-env-craftcms-3-php to $npm_package_version\""
8
8
  },
9
9
  "author": "Mike Mellor",
10
10
  "license": "ISC"
@@ -4,7 +4,7 @@
4
4
  "description": "lab-env docker config for the apache module",
5
5
  "scripts": {
6
6
  "preversion": "docker login",
7
- "postversion": "docker buildx build --target development --platform linux/amd64,linux/arm64 -t fishawack/lab-env-drupal-9-apache:$npm_package_version -t fishawack/lab-env-drupal-9-apache:latest --push . && git add . && git commit -m \"build: Bumped fishawack/lab-env-drupal-9-apache to $npm_package_version\""
7
+ "postversion": "docker buildx build --target development --platform linux/amd64,linux/arm64 -t fishawack/lab-env-drupal-9-apache:$npm_package_version -t fishawack/lab-env-drupal-9-apache:latest --push . && git add . && git commit -m \"build: bumped fishawack/lab-env-drupal-9-apache to $npm_package_version\""
8
8
  },
9
9
  "author": "Mike Mellor",
10
10
  "license": "ISC"
@@ -4,7 +4,7 @@
4
4
  "description": "lab-env docker config for the php module",
5
5
  "scripts": {
6
6
  "preversion": "docker login",
7
- "postversion": "docker buildx build --target development --platform linux/amd64,linux/arm64 -t fishawack/lab-env-drupal-9-php:$npm_package_version -t fishawack/lab-env-drupal-9-php:latest --push . && git add . && git commit -m \"build: Bumped fishawack/lab-env-drupal-9-php to $npm_package_version\""
7
+ "postversion": "docker buildx build --target development --platform linux/amd64,linux/arm64 -t fishawack/lab-env-drupal-9-php:$npm_package_version -t fishawack/lab-env-drupal-9-php:latest --push . && git add . && git commit -m \"build: bumped fishawack/lab-env-drupal-9-php to $npm_package_version\""
8
8
  },
9
9
  "author": "Mike Mellor",
10
10
  "license": "ISC"
package/globals.js CHANGED
@@ -384,6 +384,8 @@ process.env.FW_LARAVEL_10_PHP_IMAGE =
384
384
  process.env.FW_ADONIS_0_NGINX_IMAGE =
385
385
  process.env.FW_ADONIS_0_NGINX_IMAGE || `fishawack/lab-env-adonis-0-nginx`;
386
386
  process.env.FW_ADONIS_0_NODE_IMAGE = process.env.FW_ADONIS_0_NODE_IMAGE || ``;
387
+ process.env.FW_PYTHON_0_IMAGE =
388
+ process.env.FW_PYTHON_0_IMAGE || `fishawack/lab-env-python-0`;
387
389
 
388
390
  var core = `-f ${__dirname}/core/${process.env.VERSION}/docker-compose.yml`;
389
391
 
@@ -445,6 +447,9 @@ process.env.FW_ADONIS_0_NGINX_VERSION =
445
447
  require("./adonis/0/nginx/package.json").version;
446
448
  process.env.FW_ADONIS_0_NODE_VERSION =
447
449
  process.env.FW_ADONIS_0_NODE_VERSION || "";
450
+ process.env.FW_PYTHON_0_VERSION =
451
+ process.env.FW_PYTHON_0_VERSION ||
452
+ require("./python/0/package.json").version;
448
453
 
449
454
  // Map docker contexts
450
455
  process.env.FW_CORE_1_CONTEXT =
@@ -522,6 +527,16 @@ if (existsSync(path.join(contextOverride, "Dockerfile"))) {
522
527
  ).version;
523
528
  }
524
529
 
530
+ // PYTHON
531
+ process.env.FW_PYTHON_0_CONTEXT =
532
+ process.env.FW_PYTHON_0_CONTEXT || `${__dirname}/python/0/`;
533
+
534
+ contextOverride = path.join(cwd, "_Docker/python/0/");
535
+ if (existsSync(path.join(contextOverride, "Dockerfile"))) {
536
+ process.env.FW_PYTHON_0_CONTEXT = contextOverride;
537
+ process.env.FW_PYTHON_0_IMAGE += `-${repoSafe}`;
538
+ }
539
+
525
540
  // Copy env.example if .env doesnt exist
526
541
  if (
527
542
  existsSync(path.join(cwd, ".env.example")) &&
@@ -23,6 +23,8 @@ services:
23
23
  - $CWD/:/app
24
24
  ports:
25
25
  - "${PORT_WEB:-8000}:80"
26
+ depends_on:
27
+ - php
26
28
  php:
27
29
  build:
28
30
  context: $FW_LARAVEL_10_PHP_CONTEXT
@@ -24,6 +24,8 @@ services:
24
24
  - $CWD/:/app
25
25
  ports:
26
26
  - "${PORT_WEB:-8000}:80"
27
+ depends_on:
28
+ - php
27
29
  php:
28
30
  build:
29
31
  context: $DIRNAME/laravel/8/php/
@@ -1,4 +1,7 @@
1
1
  ## Changelog
2
2
 
3
+ ### 0.1.3 (2025-01-17)
4
+ * [fix] nginx now resolves on request rather than start time to avoid race conditions
5
+
3
6
  ### 0.1.2 (2023-03-02)
4
7
  * [fix] nginx now sets upload limit to 500Mb
@@ -13,6 +13,9 @@ server {
13
13
 
14
14
  charset utf-8;
15
15
 
16
+ # Docker embedded DNS
17
+ resolver 127.0.0.11 ipv6=off valid=10s;
18
+
16
19
  location / {
17
20
  try_files $uri $uri/ /index.php?$query_string;
18
21
  }
@@ -23,7 +26,8 @@ server {
23
26
  error_page 404 /index.php;
24
27
 
25
28
  location ~ \.php$ {
26
- fastcgi_pass php:9000;
29
+ set $upstream php:9000;
30
+ fastcgi_pass $upstream;
27
31
  include fastcgi_params;
28
32
  fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
29
33
  fastcgi_param SCRIPT_NAME $fastcgi_script_name;
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "nginx",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "lab-env docker config for the nginx module",
5
5
  "scripts": {
6
6
  "preversion": "docker login",
7
- "postversion": "docker buildx build --target development --platform linux/amd64,linux/arm64 -t fishawack/lab-env-laravel-8-nginx:$npm_package_version -t fishawack/lab-env-laravel-8-nginx:latest --push . && git add . && git commit -m \"build: Bumped fishawack/lab-env-laravel-8-nginx to $npm_package_version\""
7
+ "postversion": "docker buildx build --target development --platform linux/amd64,linux/arm64 -t fishawack/lab-env-laravel-8-nginx:$npm_package_version -t fishawack/lab-env-laravel-8-nginx:latest --push . && git add . && git commit -m \"build: bumped fishawack/lab-env-laravel-8-nginx to $npm_package_version\""
8
8
  },
9
9
  "author": "Mike Mellor",
10
10
  "license": "ISC"
@@ -4,7 +4,7 @@
4
4
  "description": "lab-env docker config for the php module",
5
5
  "scripts": {
6
6
  "preversion": "docker login",
7
- "postversion": "docker buildx build --target development --platform linux/amd64,linux/arm64 -t fishawack/lab-env-laravel-8-php:$npm_package_version -t fishawack/lab-env-laravel-8-php:latest --push . && git add . && git commit -m \"build: Bumped fishawack/lab-env-laravel-8-php to $npm_package_version\""
7
+ "postversion": "docker buildx build --target development --platform linux/amd64,linux/arm64 -t fishawack/lab-env-laravel-8-php:$npm_package_version -t fishawack/lab-env-laravel-8-php:latest --push . && git add . && git commit -m \"build: bumped fishawack/lab-env-laravel-8-php to $npm_package_version\""
8
8
  },
9
9
  "author": "Mike Mellor",
10
10
  "license": "ISC"
@@ -23,6 +23,8 @@ services:
23
23
  - $CWD/:/app
24
24
  ports:
25
25
  - "${PORT_WEB:-8000}:80"
26
+ depends_on:
27
+ - php
26
28
  php:
27
29
  build:
28
30
  context: $FW_LARAVEL_9_PHP_CONTEXT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fishawack/lab-env",
3
- "version": "5.1.0",
3
+ "version": "5.2.0-beta.2",
4
4
  "description": "Docker manager for FW",
5
5
  "main": "cli.js",
6
6
  "scripts": {
@@ -4,7 +4,7 @@
4
4
  "description": "lab-env docker config for the php module",
5
5
  "scripts": {
6
6
  "preversion": "docker login",
7
- "postversion": "docker buildx build --target development --platform linux/amd64,linux/arm64 -t fishawack/lab-env-php-8-2:$npm_package_version -t fishawack/lab-env-php-8-2:latest --push . && git add . && git commit -m \"build: Bumped fishawack/lab-env-php-8-2 to $npm_package_version\""
7
+ "postversion": "docker buildx build --target development --platform linux/amd64,linux/arm64 -t fishawack/lab-env-php-8-2:$npm_package_version -t fishawack/lab-env-php-8-2:latest --push . && git add . && git commit -m \"build: bumped fishawack/lab-env-php-8-2 to $npm_package_version\""
8
8
  },
9
9
  "author": "Mike Mellor",
10
10
  "license": "ISC"
@@ -0,0 +1,8 @@
1
+ FROM ghcr.io/astral-sh/uv:python3.13-bookworm AS development
2
+
3
+ LABEL org.opencontainers.image.authors="Mike Mellor <mike.mellor@avalerehealth.com>"
4
+
5
+ FROM fishawack/lab-env-laravel-8-nginx:latest AS production
6
+
7
+ # Copy source code into container
8
+ COPY . /app
@@ -1,6 +1,9 @@
1
1
  services:
2
2
  python:
3
- image: ghcr.io/astral-sh/uv:python3.13-bookworm
3
+ build:
4
+ context: $FW_PYTHON_0_CONTEXT
5
+ target: development
6
+ image: $FW_PYTHON_0_IMAGE:${FW_PYTHON_0_VERSION:-latest}
4
7
  working_dir: /workspace
5
8
  command: sleep infinity
6
9
  tty: true
@@ -0,0 +1,11 @@
1
+ {
2
+ "name": "python",
3
+ "version": "1.0.0",
4
+ "description": "lab-env docker config for the python module",
5
+ "scripts": {
6
+ "preversion": "docker login",
7
+ "postversion": "docker buildx build --target development --platform linux/amd64,linux/arm64 -t fishawack/lab-env-python-0:$npm_package_version -t fishawack/lab-env-python-0:latest --push . && git add . && git commit -m \"build: bumped fishawack/lab-env-python-0 to $npm_package_version\""
8
+ },
9
+ "author": "Mike Mellor",
10
+ "license": "ISC"
11
+ }
@@ -4,7 +4,7 @@
4
4
  "description": "lab-env docker config for the wordpress module",
5
5
  "scripts": {
6
6
  "preversion": "docker login",
7
- "postversion": "docker buildx build --target development --platform linux/amd64,linux/arm64 -t fishawack/lab-env-wordpress-0:$npm_package_version -t fishawack/lab-env-wordpress-0:latest --push . && git add . && git commit -m \"build: Bumped fishawack/lab-env-wordpress-0 to $npm_package_version\""
7
+ "postversion": "docker buildx build --target development --platform linux/amd64,linux/arm64 -t fishawack/lab-env-wordpress-0:$npm_package_version -t fishawack/lab-env-wordpress-0:latest --push . && git add . && git commit -m \"build: bumped fishawack/lab-env-wordpress-0 to $npm_package_version\""
8
8
  },
9
9
  "author": "Mike Mellor",
10
10
  "license": "ISC"
@@ -4,7 +4,7 @@
4
4
  "description": "lab-env docker config for the apache module",
5
5
  "scripts": {
6
6
  "preversion": "docker login",
7
- "postversion": "docker buildx build --target development --platform linux/amd64,linux/arm64 -t fishawack/lab-env-wordpress-1-apache:$npm_package_version -t fishawack/lab-env-wordpress-1-apache:latest --push . && git add . && git commit -m \"build: Bumped fishawack/lab-env-wordpress-1-apache to $npm_package_version\""
7
+ "postversion": "docker buildx build --target development --platform linux/amd64,linux/arm64 -t fishawack/lab-env-wordpress-1-apache:$npm_package_version -t fishawack/lab-env-wordpress-1-apache:latest --push . && git add . && git commit -m \"build: bumped fishawack/lab-env-wordpress-1-apache to $npm_package_version\""
8
8
  },
9
9
  "author": "Mike Mellor",
10
10
  "license": "ISC"
@@ -4,7 +4,7 @@
4
4
  "description": "lab-env docker config for the php module",
5
5
  "scripts": {
6
6
  "preversion": "docker login",
7
- "postversion": "docker buildx build --target development --platform linux/amd64,linux/arm64 -t fishawack/lab-env-wordpress-1-php:$npm_package_version -t fishawack/lab-env-wordpress-1-php:latest --push . && git add . && git commit -m \"build: Bumped fishawack/lab-env-wordpress-1-php to $npm_package_version\""
7
+ "postversion": "docker buildx build --target development --platform linux/amd64,linux/arm64 -t fishawack/lab-env-wordpress-1-php:$npm_package_version -t fishawack/lab-env-wordpress-1-php:latest --push . && git add . && git commit -m \"build: bumped fishawack/lab-env-wordpress-1-php to $npm_package_version\""
8
8
  },
9
9
  "author": "Mike Mellor",
10
10
  "license": "ISC"