Code Monkey home page Code Monkey logo

Comments (5)

diegoalbuquerque avatar diegoalbuquerque commented on May 21, 2024

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.

diegoalbuquerque avatar diegoalbuquerque commented on May 21, 2024

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.

diegoalbuquerque avatar diegoalbuquerque commented on May 21, 2024

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",
"NJS_VERSION=1.13.7.0.1.15-1
stretch",
"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.

tiangolo avatar tiangolo commented on May 21, 2024

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.

tiangolo avatar tiangolo commented on May 21, 2024

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)

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.