Skip to content

Commit

Permalink
Merge pull request #28 from arifszn/adminer
Browse files Browse the repository at this point in the history
Add Adminer as service
  • Loading branch information
arifszn authored Aug 6, 2023
2 parents c1c9fe3 + c4ed795 commit 4ea7621
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 2 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <!-- with MySQL, PostgreSQL, Redis --> 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

Expand Down Expand Up @@ -126,7 +126,10 @@ vail up

Vail supports the following services:

- Multiple Node version
- MySQL
- Adminer
- More coming soon!

## Support

Expand Down
3 changes: 2 additions & 1 deletion src/constants/services.js
Original file line number Diff line number Diff line change
@@ -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];

Expand Down
12 changes: 12 additions & 0 deletions src/utils/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
7 changes: 7 additions & 0 deletions stubs/adminer.stub
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
adminer:
image: 'adminer'
ports:
- '${ADMINER_PORT:-8080}:${ADMINER_PORT:-8080}'
networks:
- vail

0 comments on commit 4ea7621

Please sign in to comment.