Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minio service #32

Merged
merged 6 commits into from
Aug 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 48 additions & 4 deletions 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, 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

Expand Down Expand Up @@ -126,11 +126,55 @@ vail up

Vail supports the following services:

- Multiple Node version
- MySQL
- Adminer
- [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

<p>You can show your support by starring this project.</p>
Expand Down
2 changes: 1 addition & 1 deletion src/console/init-command.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
},
]);
Expand Down
5 changes: 3 additions & 2 deletions src/constants/services.js
Original file line number Diff line number Diff line change
@@ -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];

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

17 changes: 17 additions & 0 deletions stubs/minio.stub
Original file line number Diff line number Diff line change
@@ -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
12 changes: 6 additions & 6 deletions stubs/mysql.stub
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
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}'
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'
networks:
- vail
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-p${DB_PASSWORD}"]
test: ["CMD", "mysqladmin", "ping", "-p${DB_PASSWORD:-password}"]
retries: 3
timeout: 5s