Skip to content
This repository has been archived by the owner on Sep 26, 2022. It is now read-only.

Windows build fails #36

Open
Clever-Boy opened this issue Jul 10, 2020 · 3 comments
Open

Windows build fails #36

Clever-Boy opened this issue Jul 10, 2020 · 3 comments

Comments

@Clever-Boy
Copy link

(env) C:\Projects\bootcamp>docker-compose build
Building web
Step 1/13 : FROM python:3.7.7-buster
---> e4e55e98f1e0
Step 2/13 : WORKDIR /usr/src/
---> Using cache
---> b5c8bcee73ce
Step 3/13 : ENV PYTHONDONTWRITEBYTECODE 1
---> Using cache
---> 93da15b46683
Step 4/13 : ENV PYTHONUNBUFFERED 1
---> Using cache
---> c1d88b621ac6
Step 5/13 : RUN pip install --upgrade pip
---> Using cache
---> 09f213628f58
Step 6/13 : COPY requirements.txt /usr/src/requirements.txt
---> Using cache
---> cb83e29b88c1
Step 7/13 : RUN pip install -r ./requirements.txt
---> Using cache
---> 6d65b576c1e6
Step 8/13 : COPY . /usr/src/
---> Using cache
---> 22099ed52895
Step 9/13 : RUN rm app.db
---> Running in 619257c97e26
rm: cannot remove 'app.db': No such file or directory
ERROR: Service 'web' failed to build: The command '/bin/sh -c rm app.db' returned a non-zero code: 1

@Clever-Boy
Copy link
Author

Commented Step 8

Fails at Step 10

Step 10/12 : RUN flask db upgrade
---> Running in a830c1310c16
Traceback (most recent call last):
File "/usr/local/bin/flask", line 8, in
sys.exit(main())
File "/usr/local/lib/python3.7/site-packages/flask/cli.py", line 966, in main
cli.main(prog_name="python -m flask" if as_module else None)
File "/usr/local/lib/python3.7/site-packages/flask/cli.py", line 586, in main
return super(FlaskGroup, self).main(*args, **kwargs)
File "/usr/local/lib/python3.7/site-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python3.7/site-packages/click/core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/local/lib/python3.7/site-packages/click/core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/local/lib/python3.7/site-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python3.7/site-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/usr/local/lib/python3.7/site-packages/click/decorators.py", line 21, in new_func
return f(get_current_context(), *args, **kwargs)
File "/usr/local/lib/python3.7/site-packages/flask/cli.py", line 425, in decorator
with __ctx.ensure_object(ScriptInfo).load_app().app_context():
File "/usr/local/lib/python3.7/site-packages/flask/cli.py", line 392, in load_app
app = locate_app(self, import_name, None, raise_if_not_found=False)
File "/usr/local/lib/python3.7/site-packages/flask/cli.py", line 240, in locate_app
import(module_name)
File "/usr/src/app/init.py", line 7, in
from config import Config
File "/usr/src/config.py", line 5, in
class Config:
File "/usr/src/config.py", line 13, in Config
PORT = int(os.environ.get("PORT"))
TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'
ERROR: Service 'web' failed to build: The command '/bin/sh -c flask db upgrade' returned a non-zero code: 1

@jornalistagustavoribeiro
Copy link

jornalistagustavoribeiro commented Oct 28, 2020

Same problem here, but using Ubuntu. You mananged to fix it?

Edit:

I createad a file named "app.db" and passed from that part, but now is throwing all sort of errors.

Edit 2:

I managed it to work. Will update the instructions soon.

Edit 3:

Don't use the docker container and get rid of the pusher. Run the application with "FLASK_APP=run.py flask run". It will work.

@Clever-Boy
Copy link
Author

Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants