R
Railway

✋|help

making linux program available in nixpacks

Hheiningair8/30/2023
Hi,
I want to run a golang app on railway. Within this app i use the following dependency https://github.com/sajari/docconv
This tool has some dependencies by itself. I try to install these deps using nixpacks:

# https://nixpacks.com/docs/configuration/file

# set up variables
[variables]

# install all dependencies
[phases.dependencies]
    dependsOn = ['setup'] # make sure this phase runs after the default 'setup' phase
    aptPkgs= ['poppler-utils','wv','unrtf','tidy'] # install dependencies for docconv "pdftotext"
    cmds = [
        'go get github.com/JalfResi/justext',
        'which pdftotext',
        'echo $PATH'
    ]


When i run it builds correctly and also the which command shows that it is aware of the pdftotext tool, as well as it is sitting in the $PATH !
When i then run the golang app and try to use the pdftotext tool under the hood like i would do it locally (where it works) it spits out that it cant find the tool in the PATH:

exec: "pdftotext": executable file not found in $PATH


What am I doing wrong? Is there any nixpacks trick or config var I need to set before that works like intended?

thx in advance!

id: 36ee9888-697b-488f-8b20-0269418eaf48
(private project though)

relevant build output:

#0 building with "default" instance using docker driver

 ..........
#13 [stage-0  7/13] RUN  go get github.com/JalfResi/justext
#13 1.518 go: downloading github.com/JalfResi/justext v0.0.0-20221106200834-be571e3e3052
#13 2.978 go: downloading github.com/levigross/exp-html v0.0.0-20120902181939-8df60c69a8f5
#13 DONE 3.7s
#14 [stage-0  8/13] RUN  which pdftotext
#14 0.619 /bin/pdftotext
#14 DONE 0.7s
#15 [stage-0  9/13] RUN  echo /nix/var/nix/profiles/default/bin:/nix/var/nix/profiles/default/sbin:/bin:/sbin:/usr/bin:/usr/sbin
#15 0.690 :/root/.nix-profile/bin:/root/.nix-profile/bin:/nix/var/nix/profiles/default/bin:/root/.nix-profile/bin:/nix/var/nix/profiles/default/bin:/nix/var/nix/profiles/default/sbin:/bin:/sbin:/usr/bin:/usr/sbin
Bbrody1928/30/2023
nixpacks is likely trying to run your go app in a separate slim image, to disable this set a service variable CGO_ENABLED = 1
Hheiningair8/31/2023
that helped a lot! Thank you kindly!!
Bbrody1928/31/2023
no problem 🙂

Looking for more? Join the community!

Recommended Posts
Is it normal for a deployment to be initializing this long?https://cdn.fl1nt.dev/GAGE1/YAdogAtO61.png I don't think this is normal, none of my deployments takUpdating N8N Service Via Railway CLIHello, I created a Railway project and installed N8N via a Railway template. The version I am on is Ephemeral storage concernHi I want to do programmatic NPM publishes using a Railway service I will need to basically use shelredploy after pushin to github not working anymoreit stopped to redeploy my appProject failing to deploy - 'no space available'Project: 13b3222b-eb44-433c-ad71-9174aa430a7d Has been deploying fine but started to complain about"Waiting" to deploy for 18 hours? Am I doing something wrong?I'm trying to move an app I deployed personally to a new account by setting up a new account and newQ: Help with Deploying a Medusa Server to RailwaySo, it keeps saying server crashed, but in the logs, nothing seems to be an issue. Been at it backHow do i move my project under the pro plan i just moved to?I just migrated from hobby to Pro - how do i move my projects under this? it says i need an active sDeploy appwrite on railway apphow to deploy appwrite in railway app ? , as fullstack i really like appwrite as backend and Next jsCurrent usage is $ 3.13 but current bill $5.00Please let me know how it's works, should I pay $5 for next month Project: af5712a6-cd8f-4b70-93f8-1Cannot create code snapshot right nowCannot create code snapshot right now, please review your last commit or try again If this error perrailway mediasoup portsHello, can I run mediasoup on railway? I have this errors when I try to run it. ``` Error: port binrailway cache not clearing despite NIXPACKS_NO_CACHEas title says. my railway server is not deploying without using cache.Security Page for RailwayDoes Railway have a privacy/security page that we could reference to fulfill requirements from custo