I want to use bun for my hono server in my pnpm monorepo.
nolimitlabs
HOBBYOP

7 months ago

I'm using railpack for the build but not sure why bun isn't showing up in the final container this is my railway.json

{
  "$schema": "https://schema.railpack.com",
  "steps": {
    "install-all": {
      "commands": [
        "pnpm install --frozen-lockfile"
      ],
      "deployOutputs": []
    },
    "build-web": {
      "inputs": [
        {
          "step": "install-all"
        }
      ],
      "commands": [
        {
          "cmd": "if [ \"$DEPLOY_TARGET\" = \"WEB-APP\" ]; then pnpm run build:web-app; fi",
          "shell": "sh"
        }
      ],
      "deployOutputs": [
        "apps/web-app/dist",
        "apps/web-app/Caddyfile"
      ]
    },
    "build-admin-app": {
      "inputs": [
        {
          "step": "install-all"
        }
      ],
      "commands": [
        {
          "cmd": "if [ \"$DEPLOY_TARGET\" = \"ADMIN-APP\" ]; then pnpm run build:admin-app; fi",
          "shell": "sh"
        }
      ],
      "deployOutputs": [
        "apps/admin-app/dist",
        "apps/admin-app/Caddyfile"
      ]
    },
    "build-server": {
      "inputs": [
        {
          "step": "install-all"
        }
      ],
      "commands": [
        {
          "cmd": "if [ \"$DEPLOY_TARGET\" = \"SERVER\" ]; then pnpm run build:server; fi",
          "shell": "sh"
        }
      ],
      "deployOutputs": [
        "apps/server/dist",
        "apps/server/drizzle",
        "apps/server/package.json"
      ]
    }
  },
  "deploy": {
    "base": {
      "image": "ghcr.io/railwayapp/railpack-runtime:latest"
    },
    "variables": {
      "DEPLOY_TARGET": {
        "type": "string"
      },
      "BACKEND_URL": {
        "type": "string"
      },
      "PORT": {
        "type": "string"
      },
      "RAILPACK_BUN_VERSION": {
        "type": "string",
        "value": "latest"
      }
    },
    "startCommand": "if [ \"$DEPLOY_TARGET\" = \"SERVER\" ]; then cd apps/server && pnpm run start; elif [ \"$DEPLOY_TARGET\" = \"ADMIN-APP\" ]; then caddy run --config /app/apps/admin-app/Caddyfile; else caddy run --config /app/apps/web-app/Caddyfile; fi",
    "inputs": [
      {
        "step": "build-web",
        "include": [
          "apps/web-app/dist",
          "apps/web-app/Caddyfile"
        ]
      },
      {
        "step": "build-admin-app",
        "include": [
          "apps/admin-app/dist",
          "apps/admin-app/Caddyfile"
        ]
      },
      {
        "step": "build-server",
        "include": [
          "apps/server/dist",
          "apps/server/drizzle",
          "apps/server/package.json"
        ]
      }
    ]
  }
}

0 Replies

Loading...