D
Dokploy11mo ago
RS

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
Siumauricio11mo ago
Can you share the logs of your application? @RS also your application is running on port 7070?
RS
RSOP11mo ago
yeah seems like so
Siumauricio
Siumauricio11mo ago
can you open the select?
No description
Siumauricio
Siumauricio11mo ago
and see how many items you have>?
Siumauricio
Siumauricio11mo 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?
RS
RSOP11mo 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
Siumauricio11mo ago
do you have something configured in advanced -> command?
RS
RSOP11mo 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
Siumauricio11mo ago
that's ok, did you remove it and deploy again?
RS
RSOP11mo ago
yep.
Siumauricio
Siumauricio11mo ago
that's a simple golang fiber application? I can try to create a simple project with it and see
RS
RSOP11mo ago
yeah its simple well its not quite simple it got many routes but that shouldn't affect any things
Siumauricio
Siumauricio11mo ago
yeah seems right, let me create a example to test
RS
RSOP11mo ago
hmmm igh
Siumauricio
Siumauricio11mo 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
Siumauricio11mo ago
No description
RS
RSOP11mo ago
hmmm let me switch to port 3000
Siumauricio
Siumauricio11mo ago
or try to deploy the same application of the repo and see if its working
Siumauricio
Siumauricio11mo 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
Siumauricio11mo ago
did you redeploy?
RS
RSOP11mo ago
yea indeed
Siumauricio
Siumauricio11mo ago
can you try to deploy the example from the repository?
RS
RSOP11mo ago
sure
RS
RSOP11mo ago
Siumauricio
Siumauricio11mo ago
yeah select git
Siumauricio
Siumauricio11mo ago
GitHub
GitHub - railwayapp-templates/fiber
Contribute to railwayapp-templates/fiber development by creating an account on GitHub.
Siumauricio
Siumauricio11mo ago
and branch as main and save and deploy
Siumauricio
Siumauricio11mo 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 ?
RS
RSOP11mo ago
hmmm downgrading huh i dont think that will work bc most of pkg i use dosen't wsupport 18 or lower versions
RS
RSOP11mo 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
Siumauricio11mo ago
let me test it
RS
RSOP11mo ago
ight lol
RS
RSOP11mo 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
Siumauricio11mo 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
Siumauricio11mo 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
RS
RSOP11mo ago
ight :) yeah i used render for good chuck of my time they create a ,env in ur stuff
Siumauricio
Siumauricio11mo 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
RS
RSOP11mo ago
yeah.
Siumauricio
Siumauricio11mo ago
I found the issue @RS
Siumauricio
Siumauricio11mo ago
No description
RS
RSOP11mo ago
Wow how did you got it running
Siumauricio
Siumauricio11mo 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
RS
RSOP11mo ago
Oh
Siumauricio
Siumauricio11mo ago
that cause to create multiples proceses inside the container and that makes to exited
RS
RSOP11mo ago
Ohhhh I se3
Siumauricio
Siumauricio11mo 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.
RS
RSOP11mo ago
Yeah What about the env thing
Siumauricio
Siumauricio11mo 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
Siumauricio11mo ago
let's goooo
Siumauricio
Siumauricio11mo 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
RS
RSOP11mo ago
Ooo Let me try that How to make a file mount btw
Siumauricio
Siumauricio11mo ago
in the advanced, then scroll down
RS
RSOP11mo ago
Ah ight
Siumauricio
Siumauricio11mo ago
I thought I had already fixed it lol
RS
RSOP11mo ago
Lol Ight man thanks for helping I greatly appreciate that
RS
RSOP11mo ago
There is just one more thingy lol @Siumauricio ;-;
No description
No description
Siumauricio
Siumauricio11mo ago
same application?
RS
RSOP11mo ago
Nah now it's Harbinger @Siumauricio yo?

Did you find this page helpful?