2 years ago
Might just be unable to read but - I have a /static directory at the root of my project. Upon building, it's no longer at the root - is there any way to config Nixpacks to copy this into the root of the container?
Thank you! 😅
46 Replies
2 years ago
N/A
2 years ago
I believe your app is always copied into the /app directory. You could add a cd instruction to your start command to change directory to that folder
2 years ago
use ls to verify the folder contents
2 years ago
Would that be something like this?

2 years ago
Yeah I must be doing something wrong - cd app doesn't work as above, or as the custom start command. <:ferrisMelt:1286058037592719392>
2 years ago
can you provide the error you are getting?
2 years ago
For the nixpacks config deploy or the custom start command deploy?
2 years ago
For the custom start command of cd app:

2 years ago
remove the nixpacks config and your start command, let's start over
2 years ago
Yep, done 😅
2 years ago
okay now what error are you getting
2 years ago
No error - everything runs fine, I just can't access the /static directory
2 years ago
This is the path I'm using to open the file:
let file = File::open("static/changelog.md")?;2 years ago
what error
2 years ago
"No such file or directory"
2 years ago
I previously used this in a custom Dockerfile, but decided I'd try moving to Nixpacks since it was the only reason I had a custom Dockerfile 😅

2 years ago
Dockerfile > Nixpacks
2 years ago
Really?
2 years ago
Dockerfiles give you far more control over your build
2 years ago
I mean my Dockerfile was terrible - no caching, so it's 5 minute builds (on Rust) using the Dockerfile and 20 seconds on Nixpacks
2 years ago
oh rust
2 years ago
Yeah
2 years ago
change your pre-deploy command to ls -la
2 years ago
Huh

2 years ago
lol
2 years ago
do it via a railway.json file
2 years ago
Something like this?

2 years ago
yes
2 years ago
Alright done - it's building now
2 years ago
Also since it's definitely more relevant now - Project ID: 6fe4a25c-d387-4b3c-9e03-07bde35b7c5d
2 years ago
why's it more relevant now
2 years ago

2 years ago
interesting
2 years ago
Since the bot asks us for it whenever a help thread is created, I guess 😅
2 years ago
Hm looks like it's navigating down to where the binary is stored
2 years ago
can you try using an absolute path? /app/static/changelog.md
2 years ago
Alright, I'll try that now
2 years ago
Yeah, it's still a "No such file or directory"
2 years ago
your app is being ran in a slim image, meaning no assets but the bin are copied
2 years ago
Ahhhh, that makes sense
2 years ago
Is there any way to change that?
2 years ago
maybe, put this in a nixpacks.toml file -
[start]
runImage = 'ubuntu:jammy'
onlyIncludeFiles = ['./bin/the-sprongler', './static']2 years ago
You're an absolute lifesaver Brody - thank you so much for your help! <:shiba_heart:1017513599478005912>
2 years ago
It works perfectly now 😄
2 years ago
awsome!
2 years ago
!s
Status changed to Solved brody • over 1 year ago