Coder Social home page Coder Social logo

Comments (3)

tiangolo avatar tiangolo commented on May 2, 2024 1

Sorry for the delay @AYEG, I see you solved your problem. Nevertheless, I recently added a feature to allow overriding completely all the Nginx configuration, the new docs are here: https://github.com/tiangolo/uwsgi-nginx-flask-docker#overriding-nginx-configuration-completely

Also, on another note, I created https://github.com/tiangolo/fastapi, inspired by Flask, many of the plug-ins from this project generator and other tools.

If you are using this project generator with all the plug-ins, you would probably enjoy FastAPI a lot.

There is a also a comparable project generator to this one (but with more features): https://github.com/tiangolo/full-stack-fastapi-postgresql

from full-stack.

AYEG avatar AYEG commented on May 2, 2024

It turns out I was reading outdated information, the http_v2_module has long been included in the stable release of Nginx. To see which modules can be configured in the current Nginx version:

docker exec -it <backend_container_id> bash
nginx -V

from full-stack.

AYEG avatar AYEG commented on May 2, 2024

The easiest and probably best thing to do right now is to first try to add a *.conf file in nginx folder or edit the Nginx config in entrypoint.sh (tiangolo/uwsgi-nginx-docker#36)

integrating the uwsgi-nginx-flask base images (and nginx.conf) into the project can be done as follows:

  • include new dockerfiles for uwsgi-nginx and uwsgi-nginx-flask
  • include build commands
  • include depends_on under backend in d-c.deploy.images.yml and d-c.shared.depends.yml:
  • uwsgi-nginx
  • uwsgi-nginx-flask
    https://github.com/tiangolo/uwsgi-nginx-docker (pick the correct python version)
    copy uwsgi.ini nginx.conf and supervisord.conf entrypoint.sh into the project dir into backend folder
    copy the uwsgi.ini config file and rename it e.g. uwsgi-base-img-config.ini
    https://github.com/tiangolo/uwsgi-nginx-flask-docker (pick the correct python version)
    copy the sh scripts

Finally change the FROM lines in uwsgi-nginx-flask.dockerfile and backend.dockerfile. Make sure the copy commands in the uwsgi_nginx.dockerfile and uwsgi_nginx_flask.dockerfile use the renamed uwsgi.ini files.

Now you can edit the files and work with a single supervisord.conf within /app, I noticed that a custom nginx.conf is not used. Changing the lines entrypoint.sh will get copied into the config , or adding a *.conf file in nginx folder.

from full-stack.

Related Issues (16)

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.