npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@deathman92/adonis-sail

v0.2.1

Published

Generate a ready-to-use docker environment for your Adonis application

Downloads

16

Readme

@deathman92/adonis-sail

Generate a ready-to-use local docker environment for your Adonis application

@foadonis/magnify License

Installation

You can easily install and configure via the Ace CLI's add command.

node ace add @deathman92/adonis-sail
Manual Install & Configure

You can also manually install and configure if you'd prefer

pnpm install -D @deathman92/adonis-sail
node ace configure @deathman92/adonis-sail

Available Services

  • PostgreSQL
  • MySQL
  • MariaDB
  • Redis
  • Minio
  • MailPit
  • Meilisearch
  • Typesense

Usage

Make sure to install needed AdonisJs Package, and follow instructions before running Sail's commands. @adonisjs/lucid, @adonisjs/redis, @adonisjs/mail, @adonisjs/drive, @foadonis/magnify.

Commands

Sail Add

Add specified services to compose.yml file.

node ace sail:add [...services]

Sail Start

Starts specified services (empty for all) using docker compose up -d command. Optionally you can pass path to .env file (by default, .env file is using).

node ace sail:start [...services] [--env-file=.env]

Sail Stop

Stops specified services (empty for all) using docker compose down command.

node ace sail:stop [...services]

Sail Status

Print status of running services using docker compose ps command.

node ace sail:status

Environment Variables

After installing or adding new service, needed environment variables will be added to .env file (overwritting existing).

Example

node ace sail:add pgsql redis

.env file

+ DB_HOST=localhost
+ DB_PORT=5432
+ DB_USER=sail
+ DB_PASSWORD=password
+ DB_DATABASE=app
+ REDIS_HOST=localhost
+ REDIS_PORT=6379

Databases

To connect to your application's databases from your local machine, you may use a graphical database management application such as TablePlus. By default, exposed ports are :

  • MySQL: 3306
  • MariaDB: 3306
  • PostgreSQL: 5432
  • Redis: 6379

[!NOTE] As of now you can install only one of database services (mysql, mariadb or pgsql). Configure or add command prompt you about database you want to use if you try to install many.

Minio

If you plan to use Amazon S3 to store files while running your application in its production environment, you may wish to install the MinIO service when installing Sail. MinIO provides an S3 compatible API that you may use to develop locally using Adonis's S3 storage driver without creating "test" storage buckets in your production S3 environment. If you choose to install MinIO while installing Sail, a MinIO configuration section will be added to your application's compose.yml file.

You will need to install the official Adonis drive package with S3 service to use MinIO locally.

Then change configuration in config/drive.ts file like this:

...
s3: services.s3({
  credentials: {
    accessKeyId: env.get('AWS_ACCESS_KEY_ID'),
    secretAccessKey: env.get('AWS_SECRET_ACCESS_KEY'),
  },
  region: env.get('AWS_REGION'),
  bucket: env.get('S3_BUCKET'),
  visibility: 'public',
  endpoint: env.get('S3_ENPOINT'),
  forcePathStyle: true,
  urlBuilder: {
    async generateURL(key, bucket, s3Client) {
      return `${env.get('S3_ENDPOINT')}/${bucket}/${key}`
    },
  },
})
...

You can now use the @adonisjs/drive package to store and fetch files like you would do normally on a real AWS bucket. You can also access MinIO dashboard at : http://localhost:8900/dashboard (user: sail, password: password).

License

MIT licensed.