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 🙏

© 2025 – Pkg Stats / Ryan Hefner

compose-to-easypanel

v1.0.5

Published

create a esypanel sevice schema from a docker-compose file

Readme

Docker Compose to Easypanel

compose-to-easypanel

Easypanel is a Beautiful, Easy to use Server Control Panel based on Docker easypanel.io.

with this package you are able to create an Easypanel Schema based on your docker-compose file

Quickstart

Via Npx

The CLI can be easily run via npx:

npx compose-to-easypanel <projectName> -i <docker-compose.yml> -o <output-file.json>

Via Npm

npm install -g compose-to-easypanel
compose-to-easypanel <projectName> -i <docker-compose.yml> -o <output-file.json>

Example

Creating an Mysql application with Adminer as Dashboard

Write The Compose

./docker-compose.yml

version: "3"
services:
  adminer:
    image: adminer
    restart: always
    ports:
      - 8080:8080

  db:
    image: mysql
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: examplePassword
      MYSQL_PASSWORD: examplePasswordNonRoot

Run the CLI

npx <mysql-adminer> -i ./docker-compose.yml -o ./mysql-adminer-schema.json

Copy the Schema

after running this command you should be able to view the json schema under ./mysql-adminer-schema.json

Generated Schema:

{
  "services": [
    {
      "type": "app",
      "data": {
        "projectName": "test",
        "serviceName": "adminer",
        "source": { "type": "image", "image": "adminer" },
        "ports": [{ "published": 8080, "target": 8080 }]
      }
    },
    {
      "type": "mysql",
      "data": {
        "projectName": "test",
        "serviceName": "db",
        "rootPassword": "examplePassword",
        "password": "examplePasswordNonRoot"
      }
    }
  ]
}

Create The Services

after you copied the schema you can go to your easypanel Dashboard. Go to your-project, select templates and scroll all the way down to developer an then click Create from Schema

Please note: Domains and Proxys are currently not supported, you need to add these manually via the Easypanel dashboard

Supported Docker Compose Properties

  • image
  • container_name
  • ports
  • environment
  • volumes
  • command

Image

Docker Compose File

# ...
image: easypanel/easypanel

Generated Schema

{
  "source": {
    "type": "image",
    "image": "easypanel/easypanel"
  }
}

Container Name

The property container_name represents the serviceName, the default serviceName is the key of the service object in the docker-compose file

#...
service050:
  container_name: "my-super-container-name" # This is the serviceName
  image: easypanel/easypanel
  #...
#...
service050: # This is the serviceName
  image: easypanel/easypanel
  # ...

Ports

docker-compose file:

# ...
ports:
  # outside:inside
  - 3000:3000
  - 8000:5000

Generated Schema:

{
  "ports": [
    {
      "published": 3000,
      "target": 3000
    },
    {
      "published": 8000,
      "target": 5000
    }
  ]
}

Environment

docker-compose file:

# ...
environment:
  SECRET: my-super-secret
  ANOTHER_SECRET: ohooho-secret

Generated Schema:

{
  "env": "SECRET=my-super-secret\nANOTHER_SCRET=ohooho-secret"
}

Its currently not supported to load your env variables through an .env file

# ...
environment:
  SECRET: ${SECRET} # that won't work !

Volumes

docker-compose file:

# ...
volumes:
  # outside:inside
  - ./my/bind:/etc/my/bind
  - my-volume:/etc/my/volume

Generated Schema:

{
  "volumes": [
    {
      "type": "bind",
      "hostPath": "./my/bind",
      "mountPath": "/etc/my/bind"
    },
    {
      "type": "volume",
      "name": "my-volume",
      "mountPath": "/etc/my/volume"
    }
  ]
}

Command

docker-compose file:

please specify the command as string!

# ...
command: yarn start # that works
# command: ["yarn", "start"] won't work !

Generated Schema:

{
  "deploy": {
    "command": "yarn start"
  }
}

Database Services

Easypanel supports all popular databases out of the box:

  • postgres
  • mysql
  • mongo
  • redis

The Cli automatically creates an database service if the official image is used, however sometimes you need to provide an custom image, to do that you need to provide and env Variable in your docker-compose named EASYPANEL_DATABASE with the value of one database service (postgres, mysql, mongo,redis)

you also need to provide an Password env variable, otherwise a new one is created

  • Mongo: MONGO_INITDB_ROOT_PASSWORD: <password>
  • Postgres: POSTGRES_PASSWORD: <password>
  • Redis: REDIS_PASSWORD: <password>
  • MySql: MYSQL_ROOT_PASSWORD: <root-pw>; MYSQL_PASSWORD: <password>

docker-compose file

db:
  image: "postgres"
  environment:
    POSTGRES_PASSWORD: "super-password"

Generated Schema

{
  "type": "postgres",
  "data": {
    "password": "super-password"
  }
}

With custom image

db:
  image: "myuser/postgres"
  environment:
    EASYPANEL_DATABASE: postgres
    PASSWORD: "super-password"

Generated Schema

{
  "type": "postgres",
  "data": {
    "image": "myuser/postgres",
    "password": "super-password"
  }
}

Contribution

Contribution is always welcome :-)

  1. Fork the Repo
  2. Create a Branch from master
  3. Edit the Source Code
  4. Submit a PR