tiangolo / uwsgi-nginx-flask-docker

Docker image with uWSGI and Nginx for Flask applications in Python running in a single container.
https://hub.docker.com/r/tiangolo/uwsgi-nginx-flask/
Apache License 2.0
2.99k stars 608 forks source link

Running Dockerfile on ARM architecture #344

Closed AlexKalopsia closed 3 months ago

AlexKalopsia commented 8 months ago

Hello, first of all, thanks for uwsgi-nginx-flask-docker .

A couple of years ago I build a python webapp that I deployed as a docker container. I am pretty sure I followed this guide: https://www.digitalocean.com/community/tutorials/how-to-build-and-deploy-a-flask-application-using-docker-on-ubuntu-18-04

Fast-forward to now, I now have a Raspberry Pi, and I want to deploy the container.

My Dockerfile currently looks like this

FROM tiangolo/uwsgi-nginx-flask:python3.8-alpine
RUN apk --update add bash nano
ENV STATIC_URL /static
ENV STATIC_PATH /app/myapp/static

# Install the dependencies
COPY ./requirements.txt /var/www/requirements.txt
RUN pip install -r /var/www/requirements.txt

The problem of course is that rpi runs on arm architecture, rather than alpine.

I would like to know if you have any pointer on how I could manage to get everything to run again.

Thank you

AlexKalopsia commented 8 months ago

As usual, as soon as I wrote the question, I found the solution. I ended up using yosukeasanoflagellin/uwsgi-nginx-flask:python3.8.7 which supports arm architecture.

The final result was

FROM yosukeasanoflagellin/uwsgi-nginx-flask:python3.8.7
RUN apt-get update && apt-get install -y bash nano
ENV STATIC_URL /static
ENV STATIC_PATH /app/myapp/static

# Install the dependencies
COPY ./requirements.txt /var/www/requirements.txt
RUN pip install -r /var/www/requirements.txt