Deployment issues in Golang project
Project id : 4e543459-a744-4198-970b-be420281426a
I am trying to deploy a go lang application, it's services where setup in a docker compose file but i noticed docker compose is not supported yet. So i created a redis and postgres service in my project but after building the deploy logs give this error : github.com/go-redis/redis/v8: /usr/local/go/pkg/tool/linux_amd64/compile: signal: killed
failed to build, error: exit status 1
34 Replies
Project ID:
4e543459-a744-4198-970b-be420281426a
please do not use air when on railway
are you using a dockerfile?
hey brody, thanks for reaching out. yes i am using a docker file, along with a docker compose .yml file
i would remove air now and retry
railway doesn't do anything with the compose file, so send me the Dockerfile please
not very ideal tbh
i just tried to tweak it now to remove air and run with go run. however if u can suggest a better one, would be much appreciated
working on it
thanks
how about the services on the docker compose, redis and postgres. that would mean i have to set that up manually? and how so.
you said you already added them didnt you?
yhh i did, was just confirming if any relative setup would be required after
have you added the service variables?
https://docs.railway.app/develop/variables#reference-variables
the
COPY .env .env
has been omitted on purpose, you should absolutely not commit your .env file to your repo
even if it is a private repoHello good morning, thanks for assisting. so i have updated the files, the build runs but it fails to connect to the db
^
yes i have
please show a screenshot of your service variables
those are not reference variables, please remove the database related variables and look at the docs page I linked on how to add the reference variables for the database
hey, thanks brody. You where a massive help
the build works and connects to the db however when i go to the web url it says application failed to respond
but the build is working fine
hello
I was sleeping lol
can you send another screenshot of your service variables
hey brody lol. yes sleep is very neccessary as developers
sometimes
so fixed it now, something to do with having to make provisions for the port railway way listens for your app
but you have really been a humongous help. I am very grateful
my senior dev
I'm glad it's working, but I'd like to make sure you do have the variables setup correctly, even if they are working
would you mind sending a screenshot of your service variables
alright, let me get a screenshot
perfect!
I always want people to use reference variables because they will auto update if you where to for instance regen your database credentials, without reference variables you'd need to manually copy them back over
yayyyhh!!😆
well all solved then, happy coding fellow go dev!
you are very right. makes it more straightfoward instead of manually updating it
once again Thank you my senior Go dev
no problem 🙂