Code Monkey home page Code Monkey logo

meinheld-gunicorn-docker's Introduction

Test Deploy

Supported tags and respective Dockerfile links

Deprecated tags

๐Ÿšจ These tags are no longer supported or maintained, they are removed from the GitHub repository, but the last versions pushed might still be available in Docker Hub if anyone has been pulling them:

  • python3.9-alpine3.13
  • python3.8-alpine3.11
  • python3.7-alpine3.8
  • python3.6
  • python3.6-alpine3.8
  • python2.7

The last date tags for these versions are:

  • python3.9-alpine3.13-2024-03-11
  • python3.8-alpine3.11-2024-03-11
  • python3.7-alpine3.8-2024-03-11
  • python3.6-2022-11-25
  • python3.6-alpine3.8-2022-11-25
  • python2.7-2022-11-25

Note: There are tags for each build date. If you need to "pin" the Docker image version you use, you can select one of those tags. E.g. tiangolo/meinheld-gunicorn:python3.7-2019-10-15.

meinheld-gunicorn

Docker image with Meinheld managed by Gunicorn for high-performance web applications in Python, with performance auto-tuning.

GitHub repo: https://github.com/tiangolo/meinheld-gunicorn-docker

Docker Hub image: https://hub.docker.com/r/tiangolo/meinheld-gunicorn/

Description

Python web applications running with Meinheld controlled by Gunicorn have some of the best performances achievable by (older) Python frameworks based on WSGI (synchronous code, instead of ASGI, which is asynchronous) (*).

This applies to frameworks like Flask and Django.

If you have an already existing application in Flask, Django, or similar frameworks, this image will give you the best performance possible (or close to that).

This image has an "auto-tuning" mechanism included, so that you can just add your code and get good performance automatically. And without making sacrifices (like logging).

Note Python 3.10 and 3.11

The current latest version of Meinheld released is 1.0.2, from May 17, 2020. This version of Meinheld requires an old version of Greenlet (>=0.4.5,<0.5) that is not compatible with Python 3.10 and 3.11. That's why the latest version of Python supported in this image is Python 3.9.

* Note on performance and features

If you are starting a new project, you might benefit from a newer and faster framework like FastAPI (based on ASGI instead of WSGI), and a Docker image like tiangolo/uvicorn-gunicorn-fastapi.

It would give you about 200% the performance achievable with an older WSGI framework (like Flask or Django), even when using this image.

Also, if you want to use new technologies like WebSockets it would be easier with a newer framework based on ASGI, like FastAPI. As the standard ASGI was designed to be able to handle asynchronous code like the one needed for WebSockets.

Technical Details

Meinheld

Meinheld is a high-performance WSGI-compliant web server.

Gunicorn

You can use Gunicorn to manage Meinheld and run multiple processes of it.

Alternatives

This image was created to be an alternative to tiangolo/uwsgi-nginx, providing about 400% the performance of that image.

And to be the base of tiangolo/meinheld-gunicorn-flask.

๐Ÿšจ WARNING: You Probably Don't Need this Docker Image

You are probably using Kubernetes or similar tools. In that case, you probably don't need this image (or any other similar base image). You are probably better off building a Docker image from scratch.


If you have a cluster of machines with Kubernetes, Docker Swarm Mode, Nomad, or other similar complex system to manage distributed containers on multiple machines, then you will probably want to handle replication at the cluster level instead of using a process manager in each container that starts multiple worker processes, which is what this Docker image does.

In those cases (e.g. using Kubernetes) you would probably want to build a Docker image from scratch, installing your dependencies, and running a single process instead of this image.

For example, using Gunicorn you could have a file app/gunicorn_conf.py with:

# Gunicorn config variables
loglevel = "info"
errorlog = "-"  # stderr
accesslog = "-"  # stdout
worker_tmp_dir = "/dev/shm"
graceful_timeout = 120
timeout = 120
keepalive = 5
threads = 3

And then you could have a Dockerfile with:

FROM python:3.9

WORKDIR /code

COPY ./requirements.txt /code/requirements.txt

RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt

COPY ./app /code/app

CMD ["gunicorn", "--conf", "app/gunicorn_conf.py", "--bind", "0.0.0.0:80", "app.main:app"]

You can read more about these ideas in the FastAPI documentation about: FastAPI in Containers - Docker as the same ideas would apply to other web applications in containers.

When to Use this Docker Image

A Simple App

You could want a process manager running multiple worker processes in the container if your application is simple enough that you don't need (at least not yet) to fine-tune the number of processes too much, and you can just use an automated default, and you are running it on a single server, not a cluster.

Docker Compose

You could be deploying to a single server (not a cluster) with Docker Compose, so you wouldn't have an easy way to manage replication of containers (with Docker Compose) while preserving the shared network and load balancing.

Then you could want to have a single container with a process manager starting several worker processes inside, as this Docker image does.

Prometheus and Other Reasons

You could also have other reasons that would make it easier to have a single container with multiple processes instead of having multiple containers with a single process in each of them.

For example (depending on your setup) you could have some tool like a Prometheus exporter in the same container that should have access to each of the requests that come.

In this case, if you had multiple containers, by default, when Prometheus came to read the metrics, it would get the ones for a single container each time (for the container that handled that particular request), instead of getting the accumulated metrics for all the replicated containers.

Then, in that case, it could be simpler to have one container with multiple processes, and a local tool (e.g. a Prometheus exporter) on the same container collecting Prometheus metrics for all the internal processes and exposing those metrics on that single container.


Read more about it all in the FastAPI documentation about: FastAPI in Containers - Docker, as the same concepts apply to other web applications in containers.

How to use

You don't have to clone this repo.

You can use this image as a base image for other images.

Assuming you have a file requirements.txt, you could have a Dockerfile like this:

FROM tiangolo/meinheld-gunicorn:python3.9

COPY ./requirements.txt /app/requirements.txt

RUN pip install --no-cache-dir --upgrade -r /app/requirements.txt

COPY ./app /app

It will expect a file at /app/app/main.py.

Or otherwise a file at /app/main.py.

And will expect it to contain a variable app with your "WSGI" application.

Then you can build your image from the directory that has your Dockerfile, e.g:

docker build -t myimage ./

Advanced usage

Environment variables

These are the environment variables that you can set in the container to configure it and their default values:

MODULE_NAME

The Python "module" (file) to be imported by Gunicorn, this module would contain the actual application in a variable.

By default:

  • app.main if there's a file /app/app/main.py or
  • main if there's a file /app/main.py

For example, if your main file was at /app/custom_app/custom_main.py, you could set it like:

docker run -d -p 80:80 -e MODULE_NAME="custom_app.custom_main" myimage

VARIABLE_NAME

The variable inside of the Python module that contains the WSGI application.

By default:

  • app

For example, if your main Python file has something like:

from flask import Flask
api = Flask(__name__)

@api.route("/")
def hello():
    return "Hello World from Flask"

In this case api would be the variable with the "WSGI application". You could set it like:

docker run -d -p 80:80 -e VARIABLE_NAME="api" myimage

APP_MODULE

The string with the Python module and the variable name passed to Gunicorn.

By default, set based on the variables MODULE_NAME and VARIABLE_NAME:

  • app.main:app or
  • main:app

You can set it like:

docker run -d -p 80:80 -e APP_MODULE="custom_app.custom_main:api" myimage

GUNICORN_CONF

The path to a Gunicorn Python configuration file.

By default:

  • /app/gunicorn_conf.py if it exists
  • /app/app/gunicorn_conf.py if it exists
  • /gunicorn_conf.py (the included default)

You can set it like:

docker run -d -p 80:80 -e GUNICORN_CONF="/app/custom_gunicorn_conf.py" myimage

WORKERS_PER_CORE

This image will check how many CPU cores are available in the current server running your container.

It will set the number of workers to the number of CPU cores multiplied by this value.

By default:

  • 2

You can set it like:

docker run -d -p 80:80 -e WORKERS_PER_CORE="3" myimage

If you used the value 3 in a server with 2 CPU cores, it would run 6 worker processes.

You can use floating point values too.

So, for example, if you have a big server (let's say, with 8 CPU cores) running several applications, and you have an ASGI application that you know won't need high performance. And you don't want to waste server resources. You could make it use 0.5 workers per CPU core. For example:

docker run -d -p 80:80 -e WORKERS_PER_CORE="0.5" myimage

In a server with 8 CPU cores, this would make it start only 4 worker processes.

WEB_CONCURRENCY

Override the automatic definition of number of workers.

By default:

  • Set to the number of CPU cores in the current server multiplied by the environment variable WORKERS_PER_CORE. So, in a server with 2 cores, by default it will be set to 4.

You can set it like:

docker run -d -p 80:80 -e WEB_CONCURRENCY="2" myimage

This would make the image start 2 worker processes, independent of how many CPU cores are available in the server.

HOST

The "host" used by Gunicorn, the IP where Gunicorn will listen for requests.

It is the host inside of the container.

So, for example, if you set this variable to 127.0.0.1, it will only be available inside the container, not in the host running it.

It's is provided for completeness, but you probably shouldn't change it.

By default:

  • 0.0.0.0

PORT

The port the container should listen on.

If you are running your container in a restrictive environment that forces you to use some specific port (like 8080) you can set it with this variable.

By default:

  • 80

You can set it like:

docker run -d -p 80:8080 -e PORT="8080" myimage

BIND

The actual host and port passed to Gunicorn.

By default, set based on the variables HOST and PORT.

So, if you didn't change anything, it will be set by default to:

  • 0.0.0.0:80

You can set it like:

docker run -d -p 80:8080 -e BIND="0.0.0.0:8080" myimage

LOG_LEVEL

The log level for Gunicorn.

One of:

  • debug
  • info
  • warning
  • error
  • critical

By default, set to info.

If you need to squeeze more performance sacrificing logging, set it to warning, for example:

You can set it like:

docker run -d -p 80:8080 -e LOG_LEVEL="warning" myimage

Custom Gunicorn configuration file

The image includes a default Gunicorn Python config file at /gunicorn_conf.py.

It uses the environment variables declared above to set all the configurations.

You can override it by including a file in:

  • /app/gunicorn_conf.py
  • /app/app/gunicorn_conf.py
  • /gunicorn_conf.py

Custom /app/prestart.sh

If you need to run anything before starting the app, you can add a file prestart.sh to the directory /app. The image will automatically detect and run it before starting everything.

For example, if you want to add Alembic SQL migrations (with SQLAlchemy), you could create a ./app/prestart.sh file in your code directory (that will be copied by your Dockerfile) with:

#! /usr/bin/env bash

# Let the DB start
sleep 10;
# Run migrations
alembic upgrade head

and it would wait 10 seconds to give the database some time to start and then run that alembic command.

If you need to run a Python script before starting the app, you could make the /app/prestart.sh file run your Python script, with something like:

#! /usr/bin/env bash

# Run custom Python script before starting
python /app/my_custom_prestart_script.py

๐Ÿšจ Alpine Python Warning

In short: You probably shouldn't use Alpine for Python projects, instead use the slim Docker image versions.


Do you want more details? Continue reading ๐Ÿ‘‡

Alpine is more useful for other languages where you build a static binary in one Docker image stage (using multi-stage Docker building) and then copy it to a simple Alpine image, and then just execute that binary. For example, using Go.

But for Python, as Alpine doesn't use the standard tooling used for building Python extensions, when installing packages, in many cases Python (pip) won't find a precompiled installable package (a "wheel") for Alpine. And after debugging lots of strange errors you will realize that you have to install a lot of extra tooling and build a lot of dependencies just to use some of these common Python packages. ๐Ÿ˜ฉ

This means that, although the original Alpine image might have been small, you end up with a an image with a size comparable to the size you would have gotten if you had just used a standard Python image (based on Debian), or in some cases even larger. ๐Ÿคฏ

And in all those cases, it will take much longer to build, consuming much more resources, building dependencies for longer, and also increasing its carbon footprint, as you are using more CPU time and energy for each build. ๐ŸŒณ

If you want slim Python images, you should instead try and use the slim versions that are still based on Debian, but are smaller. ๐Ÿค“

Tests

All the image tags, configurations, environment variables and application options are tested.

Release Notes

Latest Changes

Features

  • ๐Ÿ‘ท Avoid creating unnecessary *.pyc files with PYTHONDONTWRITEBYTECODE=1 and ensure logs are printed immediately with PYTHONUNBUFFERED=1. PR #109 by @estebanx64.

Internal

0.5.0

Features

  • โœจ Add support for multi-arch builds, including support for arm64 (e.g. Mac M1). PR #111 by @tiangolo.

Refactors

Upgrades

Docs

Internal

0.4.0

Highlights of this release:

  • Support for Python 3.9 and 3.8.
  • Deprecation of Python 3.6 and 2.7.
    • The last Python 3.6 and 2.7 images are available in Docker Hub, but they won't be updated or maintained anymore.
    • The last images with a date tag are python3.6-2022-11-25 and python2.7-2022-11-25.
  • Upgraded versions of all the dependencies.
  • Small improvements and fixes.

Features

  • โ™ป๏ธ Add pip flag --no-cache-dir to reduce disk size used. PR #38 by @tiangolo.
  • โœจ Add support for Python 3.9 and Python 3.9 Alpine. PR #24 by @gv-collibris.
  • Add Python 3.8 with Alpine 3.11. PR #16.
  • Add support for Python 3.8. PR #15.

Breaking Changes

  • ๐Ÿ”ฅ Deprecate and remove Python 3.6 and Python 2.7. PR #75 by @tiangolo.
  • ๐Ÿ”ฅ Remove support for Python 2.7. PR #41 by @tiangolo.

Docs

  • ๐Ÿ“ Add note about why Python 3.10 and 3.11 are note supported. PR #83 by @tiangolo.
  • ๐Ÿ“ Add note to discourage Alpine with Python. PR #42 by @tiangolo.
  • ๐Ÿ“ Add Kubernetes warning, when to use this image. PR #40 by @tiangolo.
  • โœ๏ธ Fix typo duplicate "Note" in Readme. PR #39 by @tiangolo.

Internal

  • โฌ†๏ธ Update mypy requirement from ^0.971 to ^0.991. PR #80 by @dependabot[bot].
  • โฌ†๏ธ Update black requirement from ^20.8b1 to ^22.10. PR #79 by @dependabot[bot].
  • โฌ†๏ธ Update docker requirement from ^5.0.3 to ^6.0.1. PR #78 by @dependabot[bot].
  • โฌ†๏ธ Update autoflake requirement from ^1.3.1 to ^2.0.0. PR #77 by @dependabot[bot].
  • โฌ†๏ธ Upgrade CI OS. PR #81 by @tiangolo.
  • ๐Ÿ”ง Update Dependabot config. PR #76 by @tiangolo.
  • ๐Ÿ‘ท Add scheduled CI. PR #74 by @tiangolo.
  • ๐Ÿ‘ท Add alls-green GitHub Action. PR #73 by @tiangolo.
  • ๐Ÿ‘ท Do not run double CI for PRs, run on push only on master. PR #72 by @tiangolo.
  • โฌ†๏ธ Update docker requirement from ^4.2.0 to ^5.0.3. PR #43 by @dependabot[bot].
  • โฌ†๏ธ Update isort requirement from ^4.3.21 to ^5.8.0. PR #32 by @dependabot[bot].
  • โฌ†๏ธ Update mypy requirement from ^0.770 to ^0.971. PR #69 by @dependabot[bot].
  • โฌ†๏ธ Bump actions/checkout from 2 to 3.1.0. PR #70 by @dependabot[bot].
  • โฌ†๏ธ Update pytest requirement from ^5.4.1 to ^7.0.1. PR #55 by @dependabot[bot].
  • โฌ†๏ธ Update black requirement from ^19.10b0 to ^20.8b1. PR #35 by @dependabot[bot].
  • โฌ†๏ธ Bump tiangolo/issue-manager from 0.2.0 to 0.4.0. PR #30 by @dependabot[bot].
  • โฌ†๏ธ Bump actions/setup-python from 1 to 4.3.0. PR #71 by @dependabot[bot].
  • ๐Ÿ”ฅ Remove unnecessary Travis backup file. PR #45 by @tiangolo.
  • ๐Ÿ‘ท Update Latest Changes GitHub Action. PR #37 by @tiangolo.
  • ๐Ÿ‘ท Add Dependabot and external requirements to get automated upgrade PRs. PR #29 by @tiangolo.
  • ๐Ÿ‘ท Add latest-changes GitHub Action, update issue-manager, and add sponsors funding. PR #21 by @tiangolo.
  • Refactor build setup:
    • Migrate to GitHub Actions for CI.
    • Centralize and simplify code and configs.
    • Update tests and types.
    • Move from Pipenv to Poetry.
    • PR #14.

0.3.0

  • Refactor tests to use env vars and add image tags for each build date, like tiangolo/meinheld-gunicorn:python3.7-2019-10-15. PR #8.

0.2.0

  • Add support for Python 2.7 (you should use Python 3.7 or Python 3.6). PR #6.

  • Upgrade Travis. PR #5.

0.1.0

  • Add support for /app/prestart.sh.

License

This project is licensed under the terms of the MIT license.

meinheld-gunicorn-docker's People

Contributors

alejsdev avatar dependabot[bot] avatar estebanx64 avatar gv-collibris avatar tiangolo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

meinheld-gunicorn-docker's Issues

Add arm64 architecture

Hi,
I've been experimenting with Docker on ARM lately (both on my M1 Mac and on Graviton-based instances on AWS), and I had to manually build this (great!) image in order to get it working there.

It does not seem to have any issues, maybe you could add an "official" ARM version?

Thanks,
Luca

python 3.5 support

Hey thanks so much for making this! Is there a way we could get a python 3.5 version as well?

Error

/usr/src/cryptopro/pycades_0.1.22769/stdafx.h:19:10: fatal error: Python.h: No such file or directory
#0 0.695 19 | #include <Python.h>

pyodbc in meinheld-gunicorn:python3.6

Hello,

I have been using meinheld-gunicorn:python3.6 for quite a year now and it had been working quite well to host a dash/plotly app in a docker image. In a recent feature update I need to add pyodbc library but the pip installation fails during the build process. AFter some searching I realized that this is due to the depenency to libc-dev unixodbc-dev packages. I tried to add the following line:

RUN apk add --no-cache gcc g++ libc-dev unixodbc-dev
but I get the error that the command apk can not be found. Do you have any suggestion on how to resolve this? Or do you suggest another docker build to use?

I have the following requirements.txt file

pyodbc==4.0.27
dash==1.4.1
plotly==4.2.0
dash-daq==0.2.1
azure-storage-blob==2.1.0
flask-caching==1.7.1
pillow==6.2.0
numpy==1.16.2
pandas==0.24.2

and my docker file is as follows:

FROM tiangolo/meinheld-gunicorn:python3.6
WORKDIR /app
ADD requirements.txt /app/
RUN pip install --no-cache-dir --trusted-host pypi.org --trusted-host files.pythonhosted.org -U pip
RUN pip install --no-cache-dir --trusted-host pypi.org --trusted-host files.pythonhosted.org --upgrade -r requirements.txt

ADD . /app/
ENV WEB_CONCURRENCY 1
ENV LOG_LEVEL debug

Performance issues: 200% CPU

Hi!

first of all, congratulate you on your work, you have some great tools here and I always use them.

Due to a problem with parallel processing with uwsgi, I have passed my Flask app from that image of uwsgi+nginx etc.. to this one of meinhled+gunicorn. Everything seems to go right, even the multiprocessing that didn't go well with uwsgi. But as soon as I start the container, the use of CPU is close to 100%, and as soon as I make a request, it reaches 200%... (this looking at it with "docker stats").

Any idea what might be happening? Thank you very much.

Regards.

How to adapt for Django

I'm trying to get a Django instance up and running on Google Cloud Run using this image as a base but I'm a not sure how exactly to customize it.

Let's say my Django instance is named foo.

Inside Docker it is called in the directory /app

So if I understand this correctly, my WSGI application lives at /app/foo/foo/wsgi.py whereas in this project it lives in /app/app/main.py

Would I just copy the contents of /app/foo/foo/wsgi.py to /app/app/main.py?

My WSGI application is literally named application, whereas this one expects app ... can I just add a variable assignment of app = application to handle this?

Security: Build new versions with fix for CVE-2021-3177

Iinm, the published images contain the CVE-2021-3177 critical security vulnerability.
Can you please publish new versions based on the current python images?
These versions are fixed: 3.6.13, 3.7.10, 3.8.8, 3.9.2

This also affects the tiangolo/meinheld-gunicorn-flask images.

Cff.

Error `Error: class uri 'egg:meinheld#gunicorn_worker' invalid or not found`

I get this error when running the container. My application fails to start.
I guessed it was greenlet, so I reverted back to version 0.4.17, but still the same issue.

See complete error

api_1       | Error: class uri 'egg:meinheld#gunicorn_worker' invalid or not found:
api_1       |
api_1       | [Traceback (most recent call last):
api_1       |   File "/usr/local/lib/python3.8/site-packages/gunicorn/util.py", line 72, in load_class
api_1       |     return pkg_resources.load_entry_point(dist, section, name)
api_1       |   File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 473, in load_entry_point
api_1       |     return get_distribution(dist).load_entry_point(group, name)
api_1       |   File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2843, in load_entry_point
api_1       |     return ep.load()
api_1       |   File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2446, in load
api_1       |     self.require(*args, **kwargs)
api_1       |   File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2469, in require
api_1       |     items = working_set.resolve(reqs, env, installer, extras=self.extras)
api_1       |   File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 775, in resolve
api_1       |     raise VersionConflict(dist, req).with_context(dependent_req)
api_1       | pkg_resources.VersionConflict: (greenlet 1.0.0 (/usr/local/lib/python3.8/site-packages), Requirement.parse('greenlet<0.5,>=0.4.5'))
api_1       | ]

Thanks

Allow use of additional gunicorn options

I would like to use --reload in my local env, so I do not need to restart the hole server again. Allow passing additional arguments would solve this and also allow settings SSL options e.g.

Error: class uri 'egg:meinheld#gunicorn_worker' invalid or not found:

I am using FROM tiangolo/meinheld-gunicorn-flask:python3.8 AS build-image

although it is giving the below error on Ubuntu 22.04

Error: class uri 'egg:meinheld#gunicorn_worker' invalid or not found:

[Traceback (most recent call last):
{"loglevel": "debug", "workers": 4, "bind": "0.0.0.0:80", "workers_per_core": 0.5, "host": "0.0.0.0", "port": "80"}
File "/usr/local/lib/python3.7/site-packages/gunicorn/util.py", line 71, in load_class
return pkg_resources.load_entry_point(dist, section, name)
File "/usr/local/lib/python3.7/site-packages/pkg_resources/init.py", line 474, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/local/lib/python3.7/site-packages/pkg_resources/init.py", line 2846, in load_entry_point
return ep.load()
File "/usr/local/lib/python3.7/site-packages/pkg_resources/init.py", line 2450, in load
return self.resolve()
File "/usr/local/lib/python3.7/site-packages/pkg_resources/init.py", line 2456, in resolve
module = import(self.module_name, fromlist=['name'], level=0)
File "/root/.local/lib/python3.7/site-packages/meinheld/init.py", line 1, in
from meinheld.server import *
ImportError: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by /root/.local/lib/python3.7/site-packages/meinheld/server.cpython-37m-x86_64-linux-gnu.so)
]

arm64 Architecture support

Hi there, M1 macs and raspberry pi use an arm64 architecture instead of an amd64 one. This makes it very difficult if not impossible to run your image. Is it possible to add the possibility of specifying the architecture of the image? Or can you add a new docker image file such as: FROM --platform=linux/arm64 python:3.9?

Pypy versions

So, for a web server, having a just in time compiled more efficient code sounds like a nice feature.

So versions based on PyPy versions (currently up to pypy:3.7) could be useful.

Thoughts?

404 on static files

Hi, I have a django project and previously I was using uWSGI and nginx, I was serving static files directly with nginx. However, I wanted a single container for my project so I tried to migrate to this.

After setting it up with Django, everything seems to be working fine, except static files like css, js and images not loading. Do I need something like nginx to serve them as I did previously with this project as well?

From the docker logs I can see:
Not Found: /static/css/main.css

And if I enable debug mode, I get the standard Django error page saying:

 Using the URLconf defined in base.urls, Django tried these URL patterns, in this order:

1. [name='home'] 
2. ...

The current path, static/css/main.css, didnโ€™t match any of these.

entrypoint.sh script in debug mode

thanks for the nice work!
issue when running in sleep mode:
" Attaching to dockerflask_web_1
web_1 | /entrypoint.sh: 22: [: bash: unexpected operator "

Would that be a better way to check for arguments?
22 if [ $# -eq 0 ]; then
23 gunicorn -k egg:meinheld#gunicorn_worker -c "$GUNICORN_CONF" "$APP_MODULE"

Add support for arm containers

Hey,
I want to run this on a raspberrypi, which means I need an ARM container (arm, armf, or aarch64, all work). Any chance of adding that?

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.