From 7198507f3475aa976fe2823eac0062b903d57914 Mon Sep 17 00:00:00 2001 From: Ariful Alam Date: Sun, 6 Aug 2023 15:45:19 +0600 Subject: [PATCH 1/2] Add selected services as dependencies of the app service --- README.md | 1 + src/utils/index.js | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/README.md b/README.md index cdb0322..8cebc2d 100644 --- a/README.md +++ b/README.md @@ -126,6 +126,7 @@ vail up Vail supports the following services: +- Multiple Node version - MySQL ## Support diff --git a/src/utils/index.js b/src/utils/index.js index fd54b91..b7948b5 100644 --- a/src/utils/index.js +++ b/src/utils/index.js @@ -56,6 +56,18 @@ const writeDockerComposeFileWithService = ( }); } + // Add selected services as dependencies of the app service + if (selectedServices.length > 0) { + if (!parsedCompose.services.app.depends_on) { + parsedCompose.services.app.depends_on = []; + } + selectedServices.forEach((service) => { + if (!parsedCompose.services.app.depends_on.includes(service)) { + parsedCompose.services.app.depends_on.push(service); + } + }); + } + // Convert the JavaScript object back to YAML format const updatedComposeContent = yaml.dump(parsedCompose); From c4ed79564297c0b9e404db656fb3c84054170e53 Mon Sep 17 00:00:00 2001 From: Ariful Alam Date: Sun, 6 Aug 2023 16:26:24 +0600 Subject: [PATCH 2/2] Add adminer as service offering --- README.md | 4 +++- src/constants/services.js | 3 ++- stubs/adminer.stub | 7 +++++++ 3 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 stubs/adminer.stub diff --git a/README.md b/README.md index 8cebc2d..2eb2cca 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ ## Introduction -**Vail** provides a Docker powered local development experience for JavaScript/TypeScript Apps that is compatible with macOS, Windows (WSL2), and Linux. Other than Docker, no software or libraries are required to be installed on your local computer before using Vail. Vail's simple CLI means you can start building your application without any previous Docker experience. +**Vail** provides a Docker powered local development experience for JavaScript/TypeScript Apps that is compatible with macOS, Windows (WSL2), and Linux. Other than Docker, no software or libraries are required to be installed on your local computer before using Vail. Vail's simple CLI means you can start building your application with MySQL, Adminer and other services without any previous Docker experience. #### Inspiration @@ -128,6 +128,8 @@ Vail supports the following services: - Multiple Node version - MySQL +- Adminer +- More coming soon! ## Support diff --git a/src/constants/services.js b/src/constants/services.js index 403410f..5478c29 100644 --- a/src/constants/services.js +++ b/src/constants/services.js @@ -1,10 +1,11 @@ const MY_SQL = 'mysql'; +const ADMINER = 'adminer'; const NODE_14 = '14'; const NODE_16 = '16'; const NODE_18 = '18'; -const SERVICES = [MY_SQL]; +const SERVICES = [MY_SQL, ADMINER]; const SERVICES_WITH_VOLUME = [MY_SQL]; diff --git a/stubs/adminer.stub b/stubs/adminer.stub new file mode 100644 index 0000000..00e6fe6 --- /dev/null +++ b/stubs/adminer.stub @@ -0,0 +1,7 @@ +adminer: + image: 'adminer' + ports: + - '${ADMINER_PORT:-8080}:${ADMINER_PORT:-8080}' + networks: + - vail + \ No newline at end of file