Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ jobs:
matrix:
image:
- name: latest
python_version: "3.9"
python_version: "3.10"
- name: python3.10
python_version: "3.10"
- name: python3.9
python_version: "3.9"
- name: python3.8
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ jobs:
matrix:
image:
- name: latest
python_version: "3.9"
python_version: "3.10"
- name: python3.10
python_version: "3.10"
- name: python3.9
python_version: "3.9"
- name: python3.8
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

## Supported tags and respective `Dockerfile` links

* [`python3.9`, `latest` _(Dockerfile)_](https://github.com/tiangolo/uwsgi-nginx-docker/blob/master/docker-images/python3.9.dockerfile)
* [`python3.10`, `latest` _(Dockerfile)_](https://github.com/tiangolo/uwsgi-nginx-docker/blob/master/docker-images/python3.10.dockerfile)
* [`python3.9`, _(Dockerfile)_](https://github.com/tiangolo/uwsgi-nginx-docker/blob/master/docker-images/python3.9.dockerfile)
* [`python3.8` _(Dockerfile)_](https://github.com/tiangolo/uwsgi-nginx-docker/blob/master/docker-images/python3.8.dockerfile)
* [`python3.7`, _(Dockerfile)_](https://github.com/tiangolo/uwsgi-nginx-docker/blob/master/docker-images/python3.7.dockerfile)
* [`python3.6` _(Dockerfile)_](https://github.com/tiangolo/uwsgi-nginx-docker/blob/master/docker-images/python3.6.dockerfile)
Expand Down
72 changes: 72 additions & 0 deletions docker-images/python3.10.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
FROM python:3.10-buster

LABEL maintainer="Sebastian Ramirez <tiangolo@gmail.com>"

COPY install-nginx-debian.sh /

RUN bash /install-nginx-debian.sh

# Install requirements
COPY requirements.txt /tmp/requirements.txt
RUN pip install --no-cache-dir -r /tmp/requirements.txt

EXPOSE 80

# Expose 443, in case of LTS / HTTPS
EXPOSE 443

# Remove default configuration from Nginx
RUN rm /etc/nginx/conf.d/default.conf
# Copy the base uWSGI ini file to enable default dynamic uwsgi process number
COPY uwsgi.ini /etc/uwsgi/

# Install Supervisord
RUN apt-get update && apt-get install -y supervisor \
&& rm -rf /var/lib/apt/lists/*
# Custom Supervisord config
COPY supervisord-debian.conf /etc/supervisor/conf.d/supervisord.conf

# Copy stop-supervisor.sh to kill the supervisor and substasks on app failure
COPY stop-supervisor.sh /etc/supervisor/stop-supervisor.sh
RUN chmod +x /etc/supervisor/stop-supervisor.sh

# Which uWSGI .ini file should be used, to make it customizable
ENV UWSGI_INI /app/uwsgi.ini

# By default, run 2 processes
ENV UWSGI_CHEAPER 2

# By default, when on demand, run up to 16 processes
ENV UWSGI_PROCESSES 16

# By default, allow unlimited file sizes, modify it to limit the file sizes
# To have a maximum of 1 MB (Nginx's default) change the line to:
# ENV NGINX_MAX_UPLOAD 1m
ENV NGINX_MAX_UPLOAD 0

# By default, Nginx will run a single worker process, setting it to auto
# will create a worker for each CPU core
ENV NGINX_WORKER_PROCESSES 1

# By default, Nginx listens on port 80.
# To modify this, change LISTEN_PORT environment variable.
# (in a Dockerfile or with an option for `docker run`)
ENV LISTEN_PORT 80

# Copy start.sh script that will check for a /app/prestart.sh script and run it before starting the app
COPY start.sh /start.sh
RUN chmod +x /start.sh

# Copy the entrypoint that will generate Nginx additional configs
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh

ENTRYPOINT ["/entrypoint.sh"]

# Add demo app
COPY ./app /app
WORKDIR /app

# Run the start script, it will check for an /app/prestart.sh script (e.g. for migrations)
# And then will start Supervisor, which in turn will start Nginx and uWSGI
CMD ["/start.sh"]
2 changes: 1 addition & 1 deletion docker-images/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
uwsgi==2.0.19.1
uwsgi==2.0.20
2 changes: 1 addition & 1 deletion scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use_tag="tiangolo/uwsgi-nginx:$NAME"
DOCKERFILE="$NAME"

if [ "$NAME" == "latest" ] ; then
DOCKERFILE="python3.9"
DOCKERFILE="python3.10"
fi

docker build -t "$use_tag" --file "./docker-images/${DOCKERFILE}.dockerfile" "./docker-images/"
3 changes: 2 additions & 1 deletion scripts/process_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
import sys

environments = [
{"NAME": "latest", "PYTHON_VERSION": "3.9"},
{"NAME": "latest", "PYTHON_VERSION": "3.10"},
{"NAME": "python3.10", "PYTHON_VERSION": "3.10"},
{"NAME": "python3.9", "PYTHON_VERSION": "3.9"},
{"NAME": "python3.8", "PYTHON_VERSION": "3.8"},
{"NAME": "python3.7", "PYTHON_VERSION": "3.7"},
Expand Down