Buuntu/fastapi-react

Error forntend docker. it cannot run

ukomiljon opened this issue · 8 comments

invalid option nameset: pipefail

Can you elaborate on the error? Is this when you run docker-compose up -d after project creation?

yes. it happen when we run docker-compose up -d. it is for front end only.

and it is on windows 10.

So this is the output from docker-compose logs frontend?

Okay I took out the pipefail command although it should be working in Windows anyway since it runs within Docker. Unless you are running the script outside of Docker.

Go ahead and try now, you'll have to redownload the cookiecutter template.

Thanks to try to fix it. but this time we have error on frontend and nginx containers

frontend:
docker logs -f 606cf3602c93e15958355a07f72aa936058af5925e0fba04b6495302dd7b217d
/app/run.sh: line 2: $'\r': command not found
/app/run.sh: line 3: syntax error near unexpected token $'in\r'' 'app/run.sh: line 3: case $1 in

nginx:
docker logs -f 5fed2111865bb652403463becdbc09a23236d8658e23e1aac9eaf6b9d588f918
2020/06/05 04:31:46 [emerg] 1#1: host not found in upstream "frontend" in /etc/nginx/conf.d/default.conf:10
nginx: [emerg] host not found in upstream "frontend" in /etc/nginx/conf.d/default.conf:10

container ls --all

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
af6f4bc6ba54 fastbi3_backend "python app/main.py" 24 seconds ago Up 18 seconds fastbi3_backend_1
606cf3602c93 fastbi3_frontend "/bin/bash /app/run.…" 38 seconds ago Exited (2) 26 seconds ago fastbi3_frontend_1
cc433a92b35c mher/flower "flower flower --bro…" 39 seconds ago Up 27 seconds 0.0.0.0:5555->5555/tcp fastbi3_flower_1
5fed2111865b nginx:1.17 "nginx -g 'daemon of…" 40 seconds ago Exited (1) 29 seconds ago fastbi3_nginx_1
36860e884d57 fastbi3_worker "celery worker -A ap…" 49 seconds ago Up 40 seconds fastbi3_worker_1
0134c001b87d redis "docker-entrypoint.s…" 49 seconds ago Up 39 seconds 0.0.0.0:6379->6379/tcp fastbi3_redis_1
8d9f37badd24 postgres:12 "docker-entrypoint.s…" 49 seconds ago Up 41 seconds 0.0.0.0:5432->5432/tcp fastbi3_postgres_1

This sounds like a Windows line ending issue. I assume it might be because you resaved the run.sh file in Windows and now it has those line endings which are not compatible with Docker (the containers are all Linux containers). Try running dos2unix on that file and rebuilding the containers.

See:
https://stackoverflow.com/a/56417524/3908605
https://stackoverflow.com/a/51582100/3908605

ok, thanks

Assuming this is a Windows file ending issue but if more people get similar errors, I will reopen.