Deploy support

Hello there, I'm trying to run my Go FIber app on my Server which have Dokploy on it, but most of the time if it starts it either exit without an error or dont even show up and on the client side gives me a bad gateway error. Traefik config seems to look good to me but who knows
http:
routers:
dscinflux-api-405b84-router-6:
rule: Host(`api.dscinflux.xyz`) && PathPrefix(`/`)
service: dscinflux-api-405b84-service-6
middlewares:
- redirect-to-https
entryPoints:
- web
- websecure
dscinflux-api-405b84-router-7:
rule: >-
Host(`dscinflux-api-405b84-ec0ec2-51-195-201-44.traefik.me`) &&
PathPrefix(`/`)
service: dscinflux-api-405b84-service-7
middlewares: []
entryPoints:
- web
services:
dscinflux-api-405b84-service-6:
loadBalancer:
servers:
- url: http://dscinflux-api-405b84:7070
passHostHeader: true
dscinflux-api-405b84-service-7:
loadBalancer:
servers:
- url: http://dscinflux-api-405b84:3000
passHostHeader: true
http:
routers:
dscinflux-api-405b84-router-6:
rule: Host(`api.dscinflux.xyz`) && PathPrefix(`/`)
service: dscinflux-api-405b84-service-6
middlewares:
- redirect-to-https
entryPoints:
- web
- websecure
dscinflux-api-405b84-router-7:
rule: >-
Host(`dscinflux-api-405b84-ec0ec2-51-195-201-44.traefik.me`) &&
PathPrefix(`/`)
service: dscinflux-api-405b84-service-7
middlewares: []
entryPoints:
- web
services:
dscinflux-api-405b84-service-6:
loadBalancer:
servers:
- url: http://dscinflux-api-405b84:7070
passHostHeader: true
dscinflux-api-405b84-service-7:
loadBalancer:
servers:
- url: http://dscinflux-api-405b84:3000
passHostHeader: true
pls i need some help here lol all my non go stuff works just this has been bugging me out from a long time earlier when i hosted it on Render it worked fine altough i used m custom commands such as go mod download && go run main.go i dont know if dokploy supports custom commands withot any interferance with any kind of buildpacks sooo like am i at the fault here?
Cloud Application Hosting for Developers | Render
Render is a unified cloud to build and run all your apps and websites with free TLS certificates, global CDN, private networks and auto deploys from Git.
66 Replies
Siumauricio
Siumauricioβ€’2y ago
Can you share the logs of your application? @RS also your application is running on port 7070?
ℛ𝒢𝓃
ℛ𝒢𝓃OPβ€’2y ago
yeah seems like so
Siumauricio
Siumauricioβ€’2y ago
can you open the select?
No description
Siumauricio
Siumauricioβ€’2y ago
and see how many items you have>?
Siumauricio
Siumauricioβ€’2y ago
yeah it looks like the containers are recreating when a container is dead everything looks normal, even the logs are showing the right hostname hmm let me investigate are you using nixpacks? can you show the beginning of the last deployment log?
ℛ𝒢𝓃
ℛ𝒢𝓃OPβ€’2y ago
No, its bc i've been switching between different packs to test which it works well in all of em don't work tho idk why
Siumauricio
Siumauricioβ€’2y ago
do you have something configured in advanced -> command?
ℛ𝒢𝓃
ℛ𝒢𝓃OPβ€’2y ago
i had but i've removed it. i added command " go run main.go" but it gave me "/bin/sh: 1: go: not found" lol
Siumauricio
Siumauricioβ€’2y ago
that's ok, did you remove it and deploy again?
ℛ𝒢𝓃
ℛ𝒢𝓃OPβ€’2y ago
yep.
Siumauricio
Siumauricioβ€’2y ago
that's a simple golang fiber application? I can try to create a simple project with it and see
ℛ𝒢𝓃
ℛ𝒢𝓃OPβ€’2y ago
yeah its simple well its not quite simple it got many routes but that shouldn't affect any things
Siumauricio
Siumauricioβ€’2y ago
yeah seems right, let me create a example to test
ℛ𝒢𝓃
ℛ𝒢𝓃OPβ€’2y ago
hmmm igh
Siumauricio
Siumauricioβ€’2y ago
Looks like is running fine https://github.com/railwayapp-templates/fiber I used that template is very simple and then assigned a domain http://youtube-dfghdfgh-534c64-11b99a-5-161-87-31.traefik.me/
GitHub
GitHub - railwayapp-templates/fiber
Contribute to railwayapp-templates/fiber development by creating an account on GitHub.
No description
No description
No description
Siumauricio
Siumauricioβ€’2y ago
No description
ℛ𝒢𝓃
ℛ𝒢𝓃OPβ€’2y ago
hmmm let me switch to port 3000
Siumauricio
Siumauricioβ€’2y ago
or try to deploy the same application of the repo and see if its working
Siumauricio
Siumauricioβ€’2y ago
nooo, you dont need that probably that was the reason like when you have a application is not necessary to add a port when you create a domain you set the port where your application is running and that should be all you need to do
Siumauricio
Siumauricioβ€’2y ago
did you redeploy?
ℛ𝒢𝓃
ℛ𝒢𝓃OPβ€’2y ago
yea indeed
Siumauricio
Siumauricioβ€’2y ago
can you try to deploy the example from the repository?
ℛ𝒢𝓃
ℛ𝒢𝓃OPβ€’2y ago
sure
Siumauricio
Siumauricioβ€’2y ago
yeah select git
Siumauricio
Siumauricioβ€’2y ago
GitHub
GitHub - railwayapp-templates/fiber
Contribute to railwayapp-templates/fiber development by creating an account on GitHub.
Siumauricio
Siumauricioβ€’2y ago
and branch as main and save and deploy
Siumauricio
Siumauricioβ€’2y ago
hmmm, interesting so probably is something with the application itself, looks like in the repo is using the v2.42.0 of fiber and you v2.48.0 can you try to downgrade to see ?
ℛ𝒢𝓃
ℛ𝒢𝓃OPβ€’2y ago
hmmm downgrading huh i dont think that will work bc most of pkg i use dosen't wsupport 18 or lower versions
ℛ𝒢𝓃
ℛ𝒢𝓃OPβ€’2y ago
i tried to deploy another one of my projects https://github.com/NetSocialOSS/Harbinger and it exited too lol
GitHub
GitHub - NetSocialOSS/Harbinger
Contribute to NetSocialOSS/Harbinger development by creating an account on GitHub.
Siumauricio
Siumauricioβ€’2y ago
let me test it
ℛ𝒢𝓃
ℛ𝒢𝓃OPβ€’2y ago
ight lol
ℛ𝒢𝓃
ℛ𝒢𝓃OPβ€’2y ago
btw @Siumauricio in my codes i use joho's godotenv which well require a .env so when i've deploed Harbinger i got this https://images.topiclist.xyz/users/787241442770419722/XFrDVUvH.png even tho my env is configed
Siumauricio
Siumauricioβ€’2y ago
yeah that thing is in your code you need explicity the presence of the .env file https://github.com/NetSocialOSS/Harbinger.git
GitHub
GitHub - NetSocialOSS/Harbinger
Contribute to NetSocialOSS/Harbinger development by creating an account on GitHub.
Siumauricio
Siumauricioβ€’2y ago
and we inject the enviroment variables to the container so we don't create any file to your project let me fork it and see
ℛ𝒢𝓃
ℛ𝒢𝓃OPβ€’2y ago
ight :) yeah i used render for good chuck of my time they create a ,env in ur stuff
Siumauricio
Siumauricioβ€’2y ago
actually that could be a good idea, we just inject the container variables and nothing else, but we could create a file with the .env in the directory
ℛ𝒢𝓃
ℛ𝒢𝓃OPβ€’2y ago
yeah.
Siumauricio
Siumauricioβ€’2y ago
I found the issue @RS
Siumauricio
Siumauricioβ€’2y ago
No description
ℛ𝒢𝓃
ℛ𝒢𝓃OPβ€’2y ago
Wow how did you got it running
Siumauricio
Siumauricioβ€’2y ago
you had this line of code
app := fiber.New(fiber.Config{
Prefork: true, <= you had in true change to false
app := fiber.New(fiber.Config{
Prefork: true, <= you had in true change to false
ℛ𝒢𝓃
ℛ𝒢𝓃OPβ€’2y ago
Oh
Siumauricio
Siumauricioβ€’2y ago
that cause to create multiples proceses inside the container and that makes to exited
ℛ𝒢𝓃
ℛ𝒢𝓃OPβ€’2y ago
Ohhhh I se3
Siumauricio
Siumauricioβ€’2y ago
probably in render this did not happen to you because internally they handle a limit but as here your machine gives you all the resources that's why you get the error.
ℛ𝒢𝓃
ℛ𝒢𝓃OPβ€’2y ago
Yeah What about the env thing
Siumauricio
Siumauricioβ€’2y ago
The only solution I could give you is to create an .env in your repository, because in your code you have validated that if or if you read a .env file or let me try something maybe with the mounts you can achieve this
Siumauricio
Siumauricioβ€’2y ago
let's goooo
Siumauricio
Siumauricioβ€’2y ago
what you can do is to create a File mount and then specify the enviroment variables and when you deploy it automatically will create a folder called files with the file you've specified, and then in your code read the .env file to be inside the files/.env
No description
No description
ℛ𝒢𝓃
ℛ𝒢𝓃OPβ€’2y ago
Ooo Let me try that How to make a file mount btw
Siumauricio
Siumauricioβ€’2y ago
in the advanced, then scroll down
ℛ𝒢𝓃
ℛ𝒢𝓃OPβ€’2y ago
Ah ight
Siumauricio
Siumauricioβ€’2y ago
I thought I had already fixed it lol
ℛ𝒢𝓃
ℛ𝒢𝓃OPβ€’2y ago
Lol Ight man thanks for helping I greatly appreciate that
ℛ𝒢𝓃
ℛ𝒢𝓃OPβ€’2y ago
There is just one more thingy lol @Siumauricio ;-;
No description
No description
Siumauricio
Siumauricioβ€’2y ago
same application?
ℛ𝒢𝓃
ℛ𝒢𝓃OPβ€’2y ago
Nah now it's Harbinger @Siumauricio yo?

Did you find this page helpful?