Giter Site home page Giter Site logo

2022-docker's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

2022-docker's Issues

copying and mounting scripts at the same time?

Thank you for your valuable videos which help others learn. I am a bit unclear on the following:

  • In your Dockerfile you have the following: COPY . /app
  • In the docker-compose you have: .:/app

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.

Which version of Python is this tested with?

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
```

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.