How does loco server works on deployment? #161
-
Hello everyone, I tried to deploy my application using loco, but the server doesn't starts on production or when I ran the docker container. How can I start this in production environment? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 6 replies
-
The same thing happens when running through docker compose:
PS: I'm using the exact docker file created by the generate. |
Beta Was this translation helpful? Give feedback.
-
Hey @arferreira, it seems like you missed including the command for running the Docker container. However, you have two options to run your container in production mode: Option 1: Utilize the -e Docker flag to pass environment variables. docker run -e LOCO_ENV=production -p 3000:3000 [IMAGE-NAME] start Option 2: Employ the --environment loco flag when initiating your Docker process. docker run -p 3000:3000 [IMAGE-NAME] start --environment production |
Beta Was this translation helpful? Give feedback.
-
@arferreira, No problem :) I'm happy to help. If you need more help, we are here to assist you. BTW, what kind of backend is it? |
Beta Was this translation helpful? Give feedback.
There may be a network issue between your server and your RDS. Please consider the following potential problems:
If you have connectivity between the server and the RDS. in DB configuration under the
database
yaml section, you haveconnect_timeout
, which gets the default of 500 milliseconds. try to increase to bigger number