From 51a3d31a7d250568ff49af7d61293ca49e63f701 Mon Sep 17 00:00:00 2001 From: Ariful Alam Date: Sun, 6 Aug 2023 17:23:57 +0600 Subject: [PATCH 1/6] Define static port --- stubs/adminer.stub | 2 +- stubs/mysql.stub | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/stubs/adminer.stub b/stubs/adminer.stub index 00e6fe6..f3797d1 100644 --- a/stubs/adminer.stub +++ b/stubs/adminer.stub @@ -1,7 +1,7 @@ adminer: image: 'adminer' ports: - - '${ADMINER_PORT:-8080}:${ADMINER_PORT:-8080}' + - '${ADMINER_PORT:-8080}:8080' networks: - vail \ No newline at end of file diff --git a/stubs/mysql.stub b/stubs/mysql.stub index 8fe0d10..af8ae3e 100644 --- a/stubs/mysql.stub +++ b/stubs/mysql.stub @@ -1,7 +1,7 @@ mysql: image: 'mysql/mysql-server:8.0' ports: - - '${DB_PORT:-3306}:${DB_PORT:-3306}' + - '${DB_PORT:-3306}:3306' environment: MYSQL_ROOT_PASSWORD: '${DB_PASSWORD}' MYSQL_DATABASE: '${DB_DATABASE}' From 512e8847cf2004fd2f241ed4c5ba9bafed8b5c20 Mon Sep 17 00:00:00 2001 From: Ariful Alam Date: Sun, 6 Aug 2023 18:52:23 +0600 Subject: [PATCH 2/6] Add MinIO as service offering --- README.md | 3 ++- src/constants/services.js | 5 +++-- stubs/minio.stub | 17 +++++++++++++++++ 3 files changed, 22 insertions(+), 3 deletions(-) create mode 100644 stubs/minio.stub diff --git a/README.md b/README.md index 2eb2cca..a04e76c 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 with MySQL, Adminer and other services 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, MinIO and other services without any previous Docker experience. #### Inspiration @@ -129,6 +129,7 @@ Vail supports the following services: - Multiple Node version - MySQL - Adminer +- MinIO - More coming soon! ## Support diff --git a/src/constants/services.js b/src/constants/services.js index 5478c29..c87b8e5 100644 --- a/src/constants/services.js +++ b/src/constants/services.js @@ -1,13 +1,14 @@ const MY_SQL = 'mysql'; const ADMINER = 'adminer'; +const MINIO = 'minio'; const NODE_14 = '14'; const NODE_16 = '16'; const NODE_18 = '18'; -const SERVICES = [MY_SQL, ADMINER]; +const SERVICES = [MY_SQL, ADMINER, MINIO]; -const SERVICES_WITH_VOLUME = [MY_SQL]; +const SERVICES_WITH_VOLUME = [MY_SQL, MINIO]; const NODE_VERSIONS = [NODE_14, NODE_16, NODE_18]; diff --git a/stubs/minio.stub b/stubs/minio.stub new file mode 100644 index 0000000..d0efbd9 --- /dev/null +++ b/stubs/minio.stub @@ -0,0 +1,17 @@ +minio: + image: 'minio/minio:latest' + ports: + - '${MINIO_PORT:-9000}:9000' + - '${MINIO_CONSOLE_PORT:-8900}:8900' + environment: + MINIO_ROOT_USER: ${MINIO_ROOT_USER:-vail} + MINIO_ROOT_PASSWORD: ${MINIO_ROOT_PASSWORD:-password} + volumes: + - 'vail-minio:/data/minio' + networks: + - vail + command: minio server /data/minio --console-address ":8900" + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"] + retries: 3 + timeout: 5s \ No newline at end of file From c4a699719c724c2d7a1657184d9406a77a75d5af Mon Sep 17 00:00:00 2001 From: Ariful Alam Date: Sun, 6 Aug 2023 18:52:33 +0600 Subject: [PATCH 3/6] Use fallback env variables --- stubs/mysql.stub | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/stubs/mysql.stub b/stubs/mysql.stub index af8ae3e..d5146c8 100644 --- a/stubs/mysql.stub +++ b/stubs/mysql.stub @@ -3,10 +3,10 @@ mysql: ports: - '${DB_PORT:-3306}:3306' environment: - MYSQL_ROOT_PASSWORD: '${DB_PASSWORD}' - MYSQL_DATABASE: '${DB_DATABASE}' - MYSQL_USER: '${DB_USERNAME}' - MYSQL_PASSWORD: '${DB_PASSWORD}' + MYSQL_ROOT_PASSWORD: '${DB_PASSWORD:-password}' + MYSQL_DATABASE: '${DB_DATABASE:-vail}' + MYSQL_USER: '${DB_USERNAME:-vail}' + MYSQL_PASSWORD: '${DB_PASSWORD:-password}' MYSQL_ALLOW_EMPTY_PASSWORD: 1 volumes: - 'vail-mysql:/var/lib/mysql' From 3161a2c9aab2bbca9ebe8d675ceb1d142d999509 Mon Sep 17 00:00:00 2001 From: Ariful Alam Date: Sun, 6 Aug 2023 18:54:36 +0600 Subject: [PATCH 4/6] Update message for inputting ports --- src/console/init-command.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/console/init-command.js b/src/console/init-command.js index 9be98f6..4ef150d 100644 --- a/src/console/init-command.js +++ b/src/console/init-command.js @@ -80,7 +80,7 @@ const initCommand = async () => { type: 'input', name: 'ports', message: - 'Enter the ports to be used, separated by comma (e.g., 3000,3001):', + 'Enter the ports to be used for server, separated by comma (e.g., 3000,3001):', default: '3000', }, ]); From 6b18f8acbb84463fe9bff4a38ce2f888bc17bc52 Mon Sep 17 00:00:00 2001 From: Ariful Alam Date: Sun, 6 Aug 2023 18:55:42 +0600 Subject: [PATCH 5/6] Update healthcheck command --- stubs/mysql.stub | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stubs/mysql.stub b/stubs/mysql.stub index d5146c8..4f37e35 100644 --- a/stubs/mysql.stub +++ b/stubs/mysql.stub @@ -13,7 +13,7 @@ mysql: networks: - vail healthcheck: - test: ["CMD", "mysqladmin", "ping", "-p${DB_PASSWORD}"] + test: ["CMD", "mysqladmin", "ping", "-p${DB_PASSWORD:-password}"] retries: 3 timeout: 5s \ No newline at end of file From 5e0c0259add306706d652e5f1442e1b2ee5bf4e0 Mon Sep 17 00:00:00 2001 From: Ariful Alam Date: Sun, 6 Aug 2023 19:39:53 +0600 Subject: [PATCH 6/6] Explain Available Services --- README.md | 51 +++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 47 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index a04e76c..97fc619 100644 --- a/README.md +++ b/README.md @@ -126,12 +126,55 @@ vail up Vail supports the following services: -- Multiple Node version -- MySQL -- Adminer -- MinIO +- [Multiple Node version](#multiple-node-version) +- [MySQL](#mysql) +- [Adminer](#adminer) +- [MinIO](#minio) - More coming soon! +### Multiple Node version + +This service allows you to run your application with different Node.js versions without the need of installing them on your local machine. This gives you the flexibility of testing your application with various Node.js versions. + +### MySQL + +MySQL is a popular open-source relational database management system. Vail provides a pre-configured MySQL server. + +The default credentials: + +``` +Username: vail +Password: password +``` + +### Adminer + +Adminer is a full-featured database management tool. It allows you to access and manage your databases, not only MySQL but also PostgreSQL and many other relational databases are supported. + +![Adminer](https://github.com/arifszn/vail/assets/45073703/3ab55913-6869-4dd1-a55f-ec1e87385aba) + +### MinIO + +MinIO delivers AWS S3 compatible high-performance object storage. It provides the ability to store large amounts of unstructured data. In Vail, a pre-configured MinIO server is included. + +MinIO can be used to mock AWS S3 bucket in the local development environment. This is particularly handy while developing features that interact with S3 but you don't want to incur unnecessary AWS costs. To setup MinIO to act as an AWS S3 bucket: + +1. Access the MinIO dashboard via `http://localhost:8900`. + ![MinIO dashboard](https://github.com/arifszn/vail/assets/45073703/49e33577-7674-4eff-b585-1c9b04a38706) +2. Login using the MinIO root user and password provided in the Vail setup. + + The default credentials: + + ``` + Username: vail + Password: password + ``` + +3. Create a new bucket, which will act as your S3 bucket. +4. For your application, use the MinIO host, bucket name, access key, and secret key in place of the AWS S3 details. + +For a more comprehensive guide on setting up MinIO and using it to simulate S3, refer to this [article](https://dev.to/arifszn/minio-mock-s3-in-local-development-4ke6). + ## Support

You can show your support by starring this project.