deploy rust with multiple binaries
How do I choose which binary to deploy for a rust project with multiple workspaces and binaries?
56 Replies
Project ID:
N/A
N/A
even erikh didnt know the answer to this question, so... dockerfile time
ugh
ask chatgpt to write you a dockerfile
im looking at dockerfiles rn
its not a problem
how would a configuration for this look like (if railway were to add support fo rmulti binaries)?
maybe a
NIXPACKS_RUST_BINARY
option?
hold up though
I'm pretty sure there's a way to do this
Yes
There's a NIXPACKS_RUST_BIN
variable
@eirklol ty
Also, Railway will respect your
default_run
option in Cargo.tomlye
Rust | Nixpacks
App source + Nix packages + Docker = Image
its there tho
Yes
I see it in the source code
(Although I found it in the docs)
It's referenced as
RUST_BIN
, nixpacks has a wrapper around env varsinteresting
doesnt seem to be working
i think i k
nope nixpacks doesnt recognize that
oh coz its cached
NIXPACKS_NO_CACHE
= 1
maybeno
is it dockerfile time yet
yes
so
i figured out why
it finds bins by looking thru src/bins
but nooo
workspaces
why is there even multiple bins being built, sounds like a waste of time
no
theres multiple bins
my goal is to basically a monorepo
multiple packages (bins) exist, one is built
too complicated
yea too complicated for me to write patch for nixpacks to suport this
dockerfile added lets see how long it takes for me to get it right
coz i dont hae docker installed lol
I don't and can't have docker installed either
why
slow-ish internet, doesn't make sense for me to download docker images locally
its been two minutes
crashed once
no twice
omfg its installing cargo deps every single time bruh
any way to cache this lol
kinda
chatgpt time
do you have nixpacks installed
noo
install it, tell it to just output the dockerfile, and then you will see how it caches
dw
im all good
ill work on copying just the binary later
step 1: make it not error
thats a good step 1
so that dockerfile doesnt work for workspaces
u cant build without a valid cargo.toml
sounds correct
10th build rn
and its been an hour
im done
bot and website can go die
average railway user
yk what im removing the website
💀
success
coz i removed the original problem
no more mutlti bins
multi bins dumb anyway
aka pushing the problem to a later date
just only build 1 bin
ill need to make an api then
or publish a privaate crate
or dupe tons of code
too complicated
or
no website
but that was my entire goal
too bad ig
Just use
default_run
yeah i suppose i could modify Cargo.toml for each service i want to run
i also attempted to use dockerfile again but nooooo
i got it without caching but thats annoying