thisbejim / Pyrebase

A simple python wrapper for the Firebase API.
2.05k stars 526 forks source link

Can't works in docker #323

Open TaroNoguchi opened 4 years ago

TaroNoguchi commented 4 years ago

in Docker. Error below occured. It works on my own Python environment.

flask.cli.NoAppException: While importing "app", an ImportError was raised:

Traceback (most recent call last): File "/usr/local/lib/python3.6/site-packages/flask/cli.py", line 236, in locate_app import(module_name) File "/projects/app.py", line 4, in import pyrebase ModuleNotFoundError: No module named 'pyrebase'

Dockerfile and requirements.txt is below

Dockerfile
FROM python:3.6

ARG project_dir=/projects/

ADD requirements.txt $project_dir

WORKDIR $project_dir

RUN pip install -r requirements.txt

requirements.txt
###### Requirements without Version Specifiers ######
pyrebase

###### Requirements with Version Specifiers ######
asn1crypto==0.24.0
certifi==2019.6.16
cffi==1.12.3
chardet==3.0.4
Click==7.0
cryptography==2.7
docopt==0.6.2
Flask==1.0.3
Flask-SQLAlchemy==2.4.0
gunicorn==19.9.0
idna==2.8
itsdangerous==1.1.0
Jinja2==2.10.1
MarkupSafe==1.1.1
psycopg2-binary==2.8.3
pycparser==2.19
PyMySQL==0.9.3
python-dateutil==2.8.0
pythonanywhere==0.7.4
requests==2.21.0
six==1.12.0
SQLAlchemy==1.3.4
urllib3==1.24.3
Werkzeug==0.15.4
TaroNoguchi commented 4 years ago

It worked when I wrote pip install pyrebase in docker-compose.yml > command. But when I wrote it in Dockerfile > RUN, it didn't work.