a year ago
I was following your template <@539512869780455445> to deploy vite with Caddy https://github.com/brody192/vite-react-template/blob/main/Caddyfile in my monorepo but I think my nixpacks.toml is not getting picked up.
f78d75b5-8972-4d61-8517-22bbccefb41e
I created a file for my landing page in deployments/landing-nixpacks.toml
# https://nixpacks.com/docs/configuration/file
# set up some variables to minimize annoyance
[variables]
NPM_CONFIG_UPDATE_NOTIFIER = 'false' # the update notification is relatively useless in a production environment
NPM_CONFIG_FUND = 'false' # the fund notification is also pretty useless in a production environment
[phases.build]
cmds = ['pnpm --filter landing build']
# download caddy from nix
[phases.caddy]
dependsOn = [
'setup',
] # make sure this phase runs after the default 'setup' phase
nixpkgsArchive = 'ba913eda2df8eb72147259189d55932012df6301' # Caddy v2.8.4 - https://github.com/NixOS/nixpkgs/commit/ba913eda2df8eb72147259189d55932012df6301
nixPkgs = ['caddy'] # install caddy as a nix package
# format the Caddyfile with fmt
[phases.fmt]
dependsOn = [
'caddy',
] # make sure this phase runs after the 'caddy' phase so that we know we have caddy downloaded
cmds = [
'caddy fmt --overwrite Caddyfile',
] # format the Caddyfile to fix any formatting inconsistencies
# start the caddy web server
[start]
cmd = 'exec caddy run --config apps/landing/Caddyfile --adapter caddyfile 2>&1' # start caddy using the Caddyfile config and caddyfile adapter
But i noticed the configs in the service settings are not getting overriden :/
0 Replies
a year ago
values in the nixpacks.toml file can not overwrite anything in the service settings
a year ago
you are thinking of a railway.json file
a year ago
but other than that what makes you think it's not being used? have you checked the build table?
a year ago
you shouldn't need that
a year ago
perhaps you have not set the root directory correctly?
a year ago
have you read my guide? -
a year ago
gotcha
a year ago
what are you using? nx, turbo?
a year ago
you may need to adjust the the root directory in the Caddyfile
waiting on website to appear 🤞 https://landing-production-7ab3.up.railway.app
a year ago
there is no waiting, that is a 404 that caddy is returning
a year ago
^
Yeah that’s what I’m trying to figure out. I thought caddy run apps/landing/Caddyfile was the way to do it
a year ago
i was right 🙂
a year ago
no problem!