setting working directory

it seems like bun install is running in /app's parent directory. is there a way to set the working directory for all commands? see my railpack config below

{
  "$schema": "https://schema.railpack.com",
  "buildAptPackages": ["build-essential"],
  "provider": "node",
  "packages": {
    "node": "20",
    "bun": "1.2.9",
    "python": "3.10"
  },
  "caches": {
    "bun-install": {
      "directory": "/root/.bun/install/cache",
      "type": "shared"
    },
    "node-modules": {
      "directory": "/app/node_modules/.cache",
      "type": "shared"
    },
    "turbo-repo": {
      "directory": "/app/.turbo/cache",
      "type": "shared"
    }
  },
  "steps": {
    "install": {
      "caches": ["bun-install"],
      "commands": ["bun install --frozen-lockfile"],
      "inputs": [{ "step": "packages:mise" }],
      "variables": {
        "CI": "true",
        "NODE_ENV": "production"
      }
    },
    "build": {
      "caches": ["node-modules", "turbo-repo"],
      "commands": ["...", "bun run build:bot"],
      "inputs": [{ "step": "install" }],
      "secrets": ["*"]
    }
  },
  "deploy": {
    "startCommand": "bun run start:bot",
    "inputs": [{ "step": "build" }]
  }
}```

2 Replies

b6beaffc-57f9-41fe-bda7-ba432b86a1f5


a year ago

Hello,

I think you are looking for bun's --cwd flag


Welcome!

Sign in to your Railway account to join the conversation.

Loading...