providers = []
buildImage = 'ghcr.io/railwayapp/nixpacks:ubuntu-1745885067'

[variables]
CI = 'true'
NIXPACKS_METADATA = 'node'
NODE_ENV = 'production'
NPM_CONFIG_PRODUCTION = 'false'
[phases.build]
dependsOn = ['install']
cmds = ['infisical run --env=$INFISICAL_ENV --projectId=$INFISICAL_PROJECT_ID -- npm run build']
cacheDirectories = ['node_modules/.cache']

[phases.install]
dependsOn = ['setup']
cmds = [
    'curl -1sLf https://artifacts-cli.infisical.com/setup.deb.sh | sudo -E bash',
    'sudo apt-get update && sudo apt-get install -y infisical',
    'npm install'
]
cacheDirectories = ['/root/.npm']
paths = ['/app/node_modules/.bin']

[phases.setup]
nixPkgs = [
    'nodejs_24',
    'npm-9_x',
]
nixOverlays = ['https://github.com/railwayapp/nix-npm-overlay/archive/main.tar.gz']
nixpkgsArchive = '23f9169c4ccce521379e602cc82ed873a1f1b52b'
aptPkgs = ['curl']

[start]
cmd = 'infisical run --env=$INFISICAL_ENV --projectId=$INFISICAL_PROJECT_ID -- node --import ./.output/server/sentry.server.config.mjs .output/server/index.mjs'

