Comments (5)
In addition , this is my command line that I want use in production:
docker run -it --name container-migration-v2 -p 80:80 --mount type=bind,source=/srv/migemailapp/app,target=/app diego-img-server:v2
from uwsgi-nginx-flask-docker.
For some reason, the container´s entrypoint.sh it´s called with the parameters "flask run ..." -- ...
root@migracao:/srv/migemailapp# docker container inspect c18aa298836
[
{
"Id": "c18aa298836596dce78d52fa7947a410b3d1ede8e2c7b3dba93d893d9a635e63",
"Created": "2018-02-26T13:18:31.318037547Z",
"Path": "/entrypoint.sh",
"Args": [
"flask",
"run",
"--host=0.0.0.0",
"--port=80"
],
from uwsgi-nginx-flask-docker.
I understand that how I generated a new Image from a container from a debug environment, the new containers form this image always invoke this type of environment. How to change this ?
root@migracao:/srv/migemailapp# docker image inspect diego-img-server:v2
[
{
"Id": "sha256:b8ab98da0ebc626a84ad43aaffd350837aded2989499cc5e7b5859a9e51f9dba",
"RepoTags": [
"diego-img-server:v2"
],
"RepoDigests": [],
"Parent": "sha256:262c38bc192996e452ddf6b9a70ed94be7be5dbddb4372e81a7b960be20310fa",
"Comment": "",
"Created": "2018-02-23T19:18:45.928556169Z",
"Container": "85ca8552a3f3bec76169b48ef221b7616dfd70c22891d0845d5e070eb5deea45",
"ContainerConfig": {
"Hostname": "85ca8552a3f3",
"Domainname": "",
"User": "",
"AttachStdin": true,
"AttachStdout": true,
"AttachStderr": true,
"ExposedPorts": {
"443/tcp": {},
"80/tcp": {}
},
"Tty": true,
"OpenStdin": true,
"StdinOnce": true,
"Env": [
"FLASK_APP=main.py",
"FLASK_DEBUG=1",
"PATH=/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
"LANG=C.UTF-8",
"GPG_KEY=0D96DF4D4110E5C43FBFB17F2D347EA6AA65421D",
"PYTHON_VERSION=3.6.4",
"PYTHON_PIP_VERSION=9.0.1",
"NGINX_VERSION=1.13.7-1stretch",stretch",
"NJS_VERSION=1.13.7.0.1.15-1
"UWSGI_INI=/app/uwsgi.ini",
"NGINX_MAX_UPLOAD=0",
"NGINX_WORKER_PROCESSES=1",
"LISTEN_PORT=80",
"STATIC_URL=/static",
"STATIC_PATH=/app/static",
"STATIC_INDEX=1",
"PYTHONPATH=/app"
],
"Cmd": [
"flask",
"run",
"--host=0.0.0.0",
"--port=80"
],
"Image": "diego-img-server:v1",
"Volumes": null,
"WorkingDir": "/app",
"Entrypoint": [
"/entrypoint.sh"
],
"OnBuild": null,
"Labels": {}
},
from uwsgi-nginx-flask-docker.
What do you mean by:
[...] I commited to a new image.
Like in docker commit
?
If that's the case, you should never do that. If you need to change something, you should do it in a Dockerfile
.
Check out the official Docker tutorial: https://docs.docker.com/get-started/
docker run -it --name container-migration-v2 -p 80:80 --mount type=bind,source=/srv/migemailapp/app,target=/app diego-img-server:v2
You shouldn't mount an app dir inside the container, you should COPY
your app code in a Dockerfile
, build that image and then run that. After that, your prod command should look more like:
docker run -d --name container-migration-v2 -p 80:80 diego-img-server:v2
For some reason, the container´s entrypoint.sh it´s called with the parameters "flask run ..."
You are probably running docker commit
at some point. You should never use that command. You shouldn't even know it exists.
After that, follow the quick start in this same image, read the README, the quickstart section is so small that it fits complete in a laptop screen. Read it: https://github.com/tiangolo/uwsgi-nginx-flask-docker#quickstart
from uwsgi-nginx-flask-docker.
Given the lack of additional comments in some time, I'll assume you solved your problem and close this issue. But feel free to post more comments here if you want to re-open it or continue the conversation.
from uwsgi-nginx-flask-docker.
Related Issues (20)
- Nginx arm64 HOT 2
- SSL: DECRYPTION_FAILED_OR_BAD_RECORD_MAC HOT 1
- Need nginx 1.21.3
- Is it possible to suppress all `chown` calls?
- Application Factory guidance
- Ubuntu 18 or ubuntu 20.04 for uwsgi-nginx-flask-docker
- I’m getting an SSL error. HOT 1
- How to upgrade nginx through dockerfile
- Set PYTHONDONTWRITEBYTECODE environment variable
- Set PYTHONUNBUFFERED env variable
- Why running flask app.run with gunicorn and uwsgi is problematic?
- Consistent 502 Bad Gateway HOT 1
- ARM64 support HOT 3
- How to run HTTPS using waitress?
- configuring for image uploads and ML inference - issues with file buffering HOT 1
- server location
- All static files return 403 HOT 1
- Support for arm64
- How to obtain the real user IP address.
- Running Dockerfile on ARM architecture HOT 1
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-flask-docker.