Dockerfiles Generator (Experimental)

Overview

Easypanel Builders

In this repository, you will find the builders available in Easypanel.

Playground URL

Builder Definition Example

Here is how you define a builder.

import { createBuilder, joinLines } from "~builders-utils";

export default createBuilder({
  name: "Next.js",
  schema: {
    type: "object",
    required: ["packageManager", "disableTelemetry"],
    properties: {
      packageManager: {
        type: "string",
        title: "Package Manager",
        oneOf: [
          { enum: ["npm"], title: "NPM" },
          { enum: ["yarn"], title: "Yarn" },
        ],
        default: "npm",
      },
      disableTelemetry: {
        type: "boolean",
        title: "Disable Telemetry",
        default: false,
      },
    },
  } as const,
  generate({ packageManager, disableTelemetry }) {
    const dockerfileContent = joinLines([
      // ...
      "EXPOSE 3000",
      "ENV PORT 3000",
      `CMD ["node", "server.js"]`,
    ]);

    return [{ name: "Dockerfile", content: dockerfileContent }];
  },
});

Builder Properties

  • name
  • schema is a JSON Schema. This is used to generate the form and validate the input. Important: do not remove the as const at the end of your schema in order to keep the type inference working.
  • generate is the core of the builder. It receives the form data and returns file contents.
  • validate (optional) is used for custom validation rules
  • transformErrors (optional) is used for custom error messages

Defining Builders

  1. Duplicate any builder from the /builders directory
  2. Re-export the newly created builder from /builder/_list.ts
  3. Run yarn dev to open the testing playground
  4. Customize your builder.
  5. Test your builder.
  6. Send a PR.

Type Safety

Builders are written in Typescript. We try to infer as much as possible from the schema. The createBuilder function doesn't do anything at the runtime. It is only used to give you better type inference.

Custom Validation Rules

{
  // ...
  validate(formData, errors) {
    if (formData.pass1 !== formData.pass2) {
      errors.pass2.addError("Passwords don't match");
    }
    return errors;
  }
}

Custom Error Messages

{
  // ...
  transformErrors(errors) {
    return errors.map((error) => {
      if (error.name === "pattern") {
        error.message = "Only digits are allowed";
      }
      return error;
    });
  }
}

Form Fields

Select

{
  // ...
  selectField: {
    type: "string",
    title: "Select Field",
    oneOf: [
      { enum: ["first"], title: "First Option" },
      { enum: ["second"], title: "Second Option" },
      { enum: ["third"], title: "Third Option" },
    ],
  },
}
You might also like...

[Experimental] Browse local files using the non-standard File System Access API

[Experimental] Browse local files using the non-standard File System Access API

jupyterlab-filesystem-access Browse local files using the non-standard Web Browser File System Access API. ⚠️ This extension is compatible with Chromi

Apr 15, 2022

Experimental keycast plugin for Vim/Neovim

Experimental keycast plugin for Vim/Neovim

vim-keycasty Introduction Keycasty is an experimental keycast plugin for Vim/Neovim. Still work in progress. Use it just for testing. Design Keycasty

Apr 30, 2022

An experimental syntax highlighter web app bot based on Telegram's WebApp update.

Syntax Highlighter WebApp Inspired by zubiden/tg-web-bot-demo. Try the demo bot running here: @syntaxyybot Recently Telegram released a big update for

Nov 8, 2022

An experimental plugin to preview and insert block patterns in WordPress.

An experimental plugin to preview and insert block patterns in WordPress.

Block Pattern Explorer The Block Pattern Explorer is an experimental WordPress plugin based heavily on the work currently being done in Gutenberg. The

Oct 19, 2022

injects Chromium extension into packaged electron apps. highly experimental. might work.

Electron extension injector injects Chromium extension into packaged electron apps. highly experimental. might work. use Alt+Shift+E to access extensi

Sep 2, 2022

Experimental tool inspired by Capsize, implemented in Solid JS. Generates x-height and cap-height CSS

Usage Those templates dependencies are maintained via pnpm via pnpm up -Lri. This is the reason you see a pnpm-lock.yaml. That being said, any package

Jul 5, 2022

Proofie is an experimental proof-reader for VSCode that helps you write better.

Proofie is an experimental proof-reader for VSCode that helps you write better.

Proofie Proofie is an experimental proof-reader for VSCode that helps you write better. Install You can install proofie from the VSCode Marketplace. O

Jul 25, 2022

An experimental transpiler to bring tailwind macros to SWC 🚀

stailwc (speedy tailwind compiler) This is an experimental SWC transpiler to bring compile time tailwind macros to SWC (and nextjs) a-la twin macro. T

Jan 3, 2023

Experimental proxy and wrapper for safely embedding Web Archives (warc.gz, wacz) into web pages.

warc-embed-netlify 🏛️ Experimental proxy and wrapper for safely embedding Web Archives (.warc.gz, .wacz) into web pages. This particular implementati

Sep 1, 2022
Owner
Easypanel
Modern Server Control Panel
Easypanel
Write Dockerfiles and CI pipelines in TypeScript.

Trellis Write Dockerfiles and CI pipelines in TypeScript. Trellis is a portable CI/CD tool. With Trellis, you can define your Dockerfiles and CI/CD pi

Charlie Marsh 12 Nov 3, 2022
Obsidian text generator Plugin Text generator using GPT-3 (OpenAI)

is a handy plugin for Obsidian that helps you generate text content using the powerful language model GP

null 356 Dec 29, 2022
Types generator will help user to create TS types from JSON. Just paste your single object JSON the Types generator will auto-generate the interfaces for you. You can give a name for the root object

Types generator Types generator is a utility tool that will help User to create TS Interfaces from JSON. All you have to do is paste your single objec

Vineeth.TR 16 Dec 6, 2022
Experimental URL->CID index using b trees (chunky-trees from @mikeal)

ipfs-url-index Experimental IPFS index for URL->CID, implemented using chunky-trees B-Tree implementation. API Server Run node main.js to start the ap

Ilya Kreymer 2 Mar 14, 2022
Bitburner-bbpm - An experimental package manager for the game Bitburner.

BPPM - BitBurner Package Manager An experimental package manager for the game Bitburner. Install Instructions Download the latest release of bbpm.js.

null 3 Mar 24, 2022
experimental web browser optimized for rabbit-holing

Cartographist Cartographist is an experimental web browser optimized for rabbit-holing. Instead of opening new windows (with cmd-click), Cartographist

Szymon Kaliski 160 Jan 2, 2023
Halfwit is an experimental golfing language that fits most commands in half a byte.

Halfwit Halfwit is an experimental golfing language that fits most commands in half a byte. It's stack-based. Usage npm install halfwit

Chunkybanana 12 Jun 27, 2022
An experimental framework-aware Firebase CLI

Firebase Experimental framework-aware CLI Usage $ npm i -g firebase-frameworks $ cd <MY-APP> $ firebase-frameworks init $ firebase-frameworks build $

null 146 Dec 27, 2022
This experimental library patches the global custom elements registry to allow re-defining or reload a custom element.

Redefine Custom Elements This experimental library patches the global custom elements registry to allow re-defining a custom element. Based on the spe

Caridy Patiño 21 Dec 11, 2022
[Experimental] Browse local files using the non-standard File System Access API

jupyterlab-filesystem-access Browse local files using the non-standard Web Browser File System Access API. ⚠️ This extension is compatible with Chromi

Jeremy Tuloup 0 Apr 14, 2022