Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker run error: "../scripts/upgrade_db.sh: 1: cd: can't cd to server/src" #166

Open
mjabroux opened this issue Oct 10, 2022 · 0 comments

Comments

@mjabroux
Copy link

hello there,
First of all. Thanks for sharing this tool with us!!!

I get an error when I build the docker.
sudo docker run -p 8443:8000 trotto ../scripts/upgrade_db.sh: 1: cd: can't cd to server/src INFO [alembic.runtime.migration] Context impl PostgresqlImpl. INFO [alembic.runtime.migration] Will assume transactional DDL. [2022-10-10 15:20:14 +0000] [16] [INFO] Starting gunicorn 20.0.4 [2022-10-10 15:20:14 +0000] [16] [INFO] Listening at: http://0.0.0.0:8000 (16) [2022-10-10 15:20:14 +0000] [16] [INFO] Using worker: sync [2022-10-10 15:20:14 +0000] [19] [INFO] Booting worker with pid: 19 [2022-10-10 15:20:14 +0000] [20] [INFO] Booting worker with pid: 20 [2022-10-10 15:20:14 +0000] [21] [INFO] Booting worker with pid: 21 [2022-10-10 15:20:14 +0000] [22] [INFO] Booting worker with pid: 22

The original, non-docker file (upgrade_db.sh) located in the cloned repo: server/scripts/ points to a relative path:

server/scripts/upgrade_db.sh:

cd server/src
export FLASK_APP=main.py
flask db upgrade

The command cd server/src could be replaced by the full docker folder path: cd /usr/src/app/server/src/

I resolved it by replacing the cd relative path in server/scripts/upgrade_db.sh by a cd to the absolute docker folder path (cd /usr/src/app/server/src/) and by rebuilding the docker after.

server/scripts/upgrade_db.sh:

cd /usr/src/app/server/src/
export FLASK_APP=main.py

Thanks for everything!

mjabroux added a commit to mjabroux/go-links that referenced this issue Oct 14, 2022
Related to issue: trotto#166
"../scripts/upgrade_db.sh: 1: cd: can't cd to server/src"
Replacing relative path with full path
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant