I am running Docker and would like to run Python from Apache using
mod_wsgi. My Dockerfile looks as follows
FROM debian:latest
RUN apt-get update && apt-get install -y --no-install-recommends apt-utils
RUN apt-get install -y apache2
RUN apt-get install -y libapache2-mod-wsgi
RUN apt-get install -y python-dev
COPY test.py /var/www/html/
RUN chmod 755 /var/www/html/test.py
# Configure apache
RUN echo '. /etc/apache2/envvars' > /root/run_apache.sh
RUN echo 'mkdir -p /var/run/apache2' >> /root/run_apache.sh
RUN echo 'mkdir -p /var/lock/apache2' >> /root/run_apache.sh
RUN echo '/usr/sbin/apache2 -D FOREGROUND' >> /root/run_apache.sh
RUN chmod 755 /root/run_apache.sh
EXPOSE 80
CMD ["/usr/sbin/apache2ctl", "-D", "FOREGROUND"]
When I run it, the text in test.py shows up, but it's not running python.
Is there a way to have mod_wsgi load so test.py runs as python instead of
the script being printed
When I use the URL where the file is, I see that the code is run as html
and not calling python.
#!/usr/bin/env python
print("Content-type: text/html\n")
print("This is python on Apache2")
--
You received this message because you are subscribed to the Google Groups
"modwsgi" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/modwsgi.
To view this discussion on the web visit
https://groups.google.com/d/msgid/modwsgi/8af36f3e-65f7-4739-a5ce-90d450a4e4d0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.