Closed Mins0o closed 2 years ago
Wassup
I ran
$env:DB_USERNAME="Minsoo"
$env:DB_ROOT_PASSWORD="password"
$env:DB_PASSWORD="password_"
$env:MAINDB_NAME="Minsoo"
and
docker-compose -f docker-compose.yml up
in my Windows Powershell, and seems like the cs492i-api-server
is having some troubles. Is this a problem?
$env:DB_USERNAME="Minsoo" $env:DB_ROOT_PASSWORD="password" $env:DB_PASSWORD="password_" $env:MAINDB_NAME="Minsoo"
Ah I realized there is env.example
file.
You should run cp .env.example .env
first to create .env file!
Will I still need to follow the README.md?
pip install fastapi
pip install 'uvicorn[standard]'
pip install python-socketio
uvicorn main:socketio_app --reload
Nope it's from the python boilerplate code. I will update the README ASAP
Oh so I didn't update the README. to run the server, you can just use docker-compose up
command. You have nothing to configure manually now. Sorry for the inconvenience.
You should run
cp .env.example .env
first to create .env file!
Still when I run docker-compose -f docker-compose.yml up
, I get the error as:
cs492i-api-server | standard_init_linux.go:228: exec user process caused: no such file or directory
cs492i-api-server exited with code 0
cs492i-api-server exited with code 1
cs492i-api-server exited with code 1
cs492i-api-server exited with code 1
...
...
What branch are you at currently?
main.
Should I run yarn start
first?
Can you post a screenshot of your local server directory?
Well I guess yarn is not the problem since it runs yarn start at entrypoint.sh
Can you post a screenshot of your local server directory?
I think you should try with this command docker-compose up --build
I think the .env file is not in the built image happened because you build the container before making .env file
I think you should try with this command
docker-compose up --build
Still no luck :(
I detached the volume and re-ran the docker-compose up --build
.
I have more info with the "initial run" now... let me get back to you later!
Thanks for the help.
I have one volume present, is this normal?
I got it successfully running on my Linux machine, which is very very slow. I'll figure out how I can run this on my own machine later
I have one volume present, is this normal?
There should be one volume, one used by the mysql container. So I think it's right. Can you show me the error log it prints out?
Ahrrraaggggghhhhhhghghhhh I found out what was causing the problem.
The error: standard_init_linux.go:228: exec user process caused: no such file or directory
Turns out, Windows and Linux has different line ending scheme. IT WAS LITERALLY A BUG THAT IS INVISIBLE TO NAKED EYES.
You can easily fix the influenced file in VSCode.
Or change your git settings where it automatically converted all the \n
to \r\n
. 😠💢
There must be a way for Docker Desktop to make this transition automatic when copying .sh
from a Windows environment into a Linux container @docker ...
Oh so the entrypoint.sh
is copied into docker image with carriage return("\r\n")...?
Or is "\n" being converted into "\r\n" at git pulling stage?
This has bug.
This is fixed.
The fix: =>
Oh so the
entrypoint.sh
is copied into docker image with carriage return("\r\n")...? Or is "\n" being converted into "\r\n" at git pulling stage?
At the git pulling stage.
I wrote my rant over it hoping to help another poor souls who might suffer from it lol 😆 Oh there were many others including this guy😅, but to be fair, I wouldn't have known which file they were talking about.
I hate this kind of implicit things happening out of user's perception 🥲 It is almost impossible to debug things if you don't know that can actually happen... I think @dbsxodud-11 should refer to this issue if there is something awkward happening while running the server. Can you edit the README file in server directory for @dbsxodud-11 to refer to?
Can you edit the README file
Will do!
Thanks!
Questions regarding developing and running the "Server".