diff --git a/README.md b/README.md index cdb0322..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 @@ -126,7 +126,10 @@ vail up 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/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); 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