Comments (9)
@tiangolo you're welcome, I use heavily this project, so it's my way to help!
from uwsgi-nginx-docker.
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.
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.
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.
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.
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.
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.
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.
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)
- Python 3.9 images HOT 2
- Python 3.8-alpine 3.12 HOT 2
- uwsgi request is too big: XXX HOT 2
- Question: Adding OpenSSL in python3.8 Dockerfile
- Is there an easy way to turn off logs for healthcheck paths? HOT 1
- Is there a way to add certificate? HOT 2
- Information Disclosure Vulnerability in NGINX 1.21.1 HOT 2
- Why doesn't this Dockerfile simply run `apt install nginx`? HOT 2
- upgrading nginx version
- Deploy job at fork fails at docker image push step HOT 1
- Docker image based out of Debian 12 (bookworm)
- Getting uWSGI error. Exiting due to SIGTERM HOT 1
- Is this image available on ECR?
- Outdated link for "You can see the third-party benchmarks here" ? HOT 2
- How can we make tensorflow work with this docker image? HOT 2
- How do I use your image to build a Django service HOT 4
- What is the recommended way to modify conf.d? HOT 2
- Environment variable NGINX_MAX_UPLOAD is not working HOT 2
- Example Django app using this repo HOT 1
- how to read nginx error.log? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from uwsgi-nginx-docker.