Giter Club home page Giter Club logo

Comments (9)

desaintmartin avatar desaintmartin commented on May 12, 2024 2

@tiangolo you're welcome, I use heavily this project, so it's my way to help!

from uwsgi-nginx-docker.

desaintmartin avatar desaintmartin commented on May 12, 2024

Hello,
There are three solutions:
1/ Overwrite the default nginx configuration (This image is using the default nginx configuration from the official package with a few lines added at https://github.com/tiangolo/uwsgi-nginx-docker/blob/master/python3.6/Dockerfile#L107):
COPY nginx.conf.template /etc/nginx/nginx.conf
2/ Extend the nginx configuration (the default configuration includes every file in /etc/nginx/conf.d/*.conf:
COPY nginx_custom.conf.template /etc/nginx/conf.d/000_nginx_wiremind.conf
3/ Overwrite the custom nginx configuration set by the image (see https://github.com/tiangolo/uwsgi-nginx-docker/blob/master/python3.6/nginx.conf)

Personally, what I do is 1 and 2, but I guess it depend of your needs and style. :)

from uwsgi-nginx-docker.

aclowkey avatar aclowkey commented on May 12, 2024

Step 3 appeals the most, but not sure how to do it.
I copied my nginx.conf, then moved it to the place of the custom but when I look at it it didn't changed. RUN mv nginx.conf /etc/nginx/conf.d/nginx.conf

$ docker exec keen_dijkstra cat /etc/nginx/conf.d/nginx.conf                              
server {
    listen 80;
    location / {
        try_files $uri @app;
    }
    location @app {
        include uwsgi_params;
        uwsgi_pass unix:///tmp/uwsgi.sock;
    }
    location /static {
        alias /app/static;
    }
}

from uwsgi-nginx-docker.

desaintmartin avatar desaintmartin commented on May 12, 2024

Is that a Flask app? You may want to use or adapt https://github.com/tiangolo/uwsgi-nginx-flask-docker/

See how it is done in https://github.com/tiangolo/uwsgi-nginx-flask-docker/blob/a78e4f6a598ee6a115102b9dc32325c6e082b3f4/python2.7-alpine3.7/entrypoint.sh#L35 (although a simple COPY in the Dockerfile would work as well).

from uwsgi-nginx-docker.

aclowkey avatar aclowkey commented on May 12, 2024

I am using that image, I thought it will be the no different than here.
COPY didn't work..Original file remains..
Won't the entrypoint script override any file which I will put there?

from uwsgi-nginx-docker.

tiangolo avatar tiangolo commented on May 12, 2024

First, thanks @desaintmartin for all your help here 👍 👏 😄

@aclowkey do you have a public repo showing the issue? If you set one up, with the config file that you want to have and the way that you are now trying to do it, maybe I could take a look and try to spot what's happening.

from uwsgi-nginx-docker.

tiangolo avatar tiangolo commented on May 12, 2024

I just added a lot of tests to all the images, configurations and env vars, to be able to refactor the implementation without breaking anything.

I'm thinking about adding the possibility to provide a custom /app/nginx.conf file directly and use that instead of modifying/generating one. Would that solve your problem?

from uwsgi-nginx-docker.

tiangolo avatar tiangolo commented on May 12, 2024

I just finished a big refactor of the image to be able to add this feature.

You can now add your own custom /app/nginx.conf, and it will be used instead of the generated done.

Check the section in the docs here: https://github.com/tiangolo/uwsgi-nginx-docker#overriding-nginx-configuration-completely

And for the Flask version: https://github.com/tiangolo/uwsgi-nginx-flask-docker#overriding-nginx-configuration-completely

from uwsgi-nginx-docker.

tiangolo avatar tiangolo commented on May 12, 2024

As there were no more comments, I'll assume this issue is now solved with those new options. I'll close it now, but feel free to add more comments or create new issues.

from uwsgi-nginx-docker.

Related Issues (20)

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.