arjancodes / 2022-docker Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
Thank you for your valuable videos which help others learn. I am a bit unclear on the following:
What is the point of copying the directory when we will mount it under /app?
Does this suggest that when deploying it will not use this docker-compose and the code will be copied. Whereas we will use the local mount during development which is mounted using docker-compose. Thanks.
I like the concept very much but was unable to run it:
Which Python version?
FROM python:latest
may not be ideal... ?
Also, why no version numbers in requirements.txt ?
When I tried, after this :
docker build -t channel-api .
docker run -d -p 8080:80 channel-api
```
I got this :
```
2023-01-09 14:02:49 Traceback (most recent call last):
2023-01-09 14:02:49 File "/usr/local/bin/uvicorn", line 8, in <module>
2023-01-09 14:02:49 sys.exit(main())
2023-01-09 14:02:49 ^^^^^^
2023-01-09 14:02:49 File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1130, in __call__
2023-01-09 14:02:49 return self.main(*args, **kwargs)
2023-01-09 14:02:49 ^^^^^^^^^^^^^^^^^^^^^^^^^^
2023-01-09 14:02:49 File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1055, in main
2023-01-09 14:02:49 rv = self.invoke(ctx)
2023-01-09 14:02:49 ^^^^^^^^^^^^^^^^
2023-01-09 14:02:49 File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1404, in invoke
2023-01-09 14:02:49 return ctx.invoke(self.callback, **ctx.params)
2023-01-09 14:02:49 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2023-01-09 14:02:49 File "/usr/local/lib/python3.11/site-packages/click/core.py", line 760, in invoke
2023-01-09 14:02:49 return __callback(*args, **kwargs)
2023-01-09 14:02:49 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
2023-01-09 14:02:49 File "/usr/local/lib/python3.11/site-packages/uvicorn/main.py", line 404, in main
2023-01-09 14:02:49 run(
2023-01-09 14:02:49 File "/usr/local/lib/python3.11/site-packages/uvicorn/main.py", line 569, in run
2023-01-09 14:02:49 server.run()
2023-01-09 14:02:49 File "/usr/local/lib/python3.11/site-packages/uvicorn/server.py", line 60, in run
2023-01-09 14:02:49 return asyncio.run(self.serve(sockets=sockets))
2023-01-09 14:02:49 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2023-01-09 14:02:49 File "/usr/local/lib/python3.11/asyncio/runners.py", line 190, in run
2023-01-09 14:02:49 return runner.run(main)
2023-01-09 14:02:49 ^^^^^^^^^^^^^^^^
2023-01-09 14:02:49 File "/usr/local/lib/python3.11/asyncio/runners.py", line 118, in run
2023-01-09 14:02:49 return self._loop.run_until_complete(task)
2023-01-09 14:02:49 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2023-01-09 14:02:49 File "/usr/local/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete
2023-01-09 14:02:49 return future.result()
2023-01-09 14:02:49 ^^^^^^^^^^^^^^^
2023-01-09 14:02:49 File "/usr/local/lib/python3.11/site-packages/uvicorn/server.py", line 67, in serve
2023-01-09 14:02:49 config.load()
2023-01-09 14:02:49 File "/usr/local/lib/python3.11/site-packages/uvicorn/config.py", line 477, in load
2023-01-09 14:02:49 self.loaded_app = import_from_string(self.app)
2023-01-09 14:02:49 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2023-01-09 14:02:49 File "/usr/local/lib/python3.11/site-packages/uvicorn/importer.py", line 21, in import_from_string
2023-01-09 14:02:49 module = importlib.import_module(module_str)
2023-01-09 14:02:49 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2023-01-09 14:02:49 File "/usr/local/lib/python3.11/importlib/__init__.py", line 126, in import_module
2023-01-09 14:02:49 return _bootstrap._gcd_import(name[level:], package, level)
2023-01-09 14:02:49 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2023-01-09 14:02:49 File "<frozen importlib._bootstrap>", line 1206, in _gcd_import
2023-01-09 14:02:49 File "<frozen importlib._bootstrap>", line 1178, in _find_and_load
2023-01-09 14:02:49 File "<frozen importlib._bootstrap>", line 1149, in _find_and_load_unlocked
2023-01-09 14:02:49 File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
2023-01-09 14:02:49 File "<frozen importlib._bootstrap_external>", line 940, in exec_module
2023-01-09 14:02:49 File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
2023-01-09 14:02:49 File "/app/main.py", line 26, in <module>
2023-01-09 14:02:49 @app.get("/")
2023-01-09 14:02:49 ^^^^^^^^^^^^
2023-01-09 14:02:49 File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 633, in decorator
2023-01-09 14:02:49 self.add_api_route(
2023-01-09 14:02:49 File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 572, in add_api_route
2023-01-09 14:02:49 route = route_class(
2023-01-09 14:02:49 ^^^^^^^^^^^^
2023-01-09 14:02:49 File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 400, in __init__
2023-01-09 14:02:49 self.response_field = create_response_field(
2023-01-09 14:02:49 ^^^^^^^^^^^^^^^^^^^^^^
2023-01-09 14:02:49 File "/usr/local/lib/python3.11/site-packages/fastapi/utils.py", line 90, in create_response_field
2023-01-09 14:02:49 raise fastapi.exceptions.FastAPIError(
2023-01-09 14:02:49 fastapi.exceptions.FastAPIError: Invalid args for response field! Hint: check that <class 'starlette.responses.Response'> is a valid pydantic field type
```
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.