Run with CentOS7 + Apache2.4 + Python3.6 for the time being

When you just want to run it on CentOS, which you can throw away.

python3 should be installed with virtualenv.

(Addition)

Finally I wrote a Dockerfile. I just rewrote this procedure into a Dockerfile. The resulting image will be 600MB, so I think it's too heavy.

Will it still be lighter if I remake it with alpine? I would like to know the best practices for running flask in a production environment.

Versions

CentOS

CentOS Linux release 7.6.1810 (Core)

HTTPD

Also install httpd-devel.

httpd-tools-2.4.6-90.el7.centos.x86_64
httpd-2.4.6-90.el7.centos.x86_64
httpd-devel-2.4.6-90.el7.centos.x86_64

PYTHON

Enter with yum install python3

Python 3.6.8

point

yum install httpd httpd-devel python3 python3-devel gcc -y
pip3 install mod_wsgi
[root@ryo httpd]# cat /etc/httpd/conf.d/userdir.conf
<VirtualHost *:8080>
    ServerName example.com

    LoadModule wsgi_module /usr/local/lib64/python3.6/site-packages/mod_wsgi/server/mod_wsgi-py36.cpython-36m-x86_64-linux-gnu.so
    WSGIDaemonProcess ml user=vagrant group=vagrant threads=5 python-path=/usr/local/lib64/python3.6/site-packages
    WSGIScriptAlias / /opt/tryml/ryo/wsgi.wsgi

    <Directory /opt/tryml/ryo/>
        WSGIProcessGroup ml
        Order deny,allow
        Allow from all
        Require all granted
    </Directory>
</VirtualHost>

import sys, os
sys.path.insert(0, os.path.dirname(__file__))
from sebserver import app as application

reference

Dockerfile

FROM centos:7
COPY ["*.py", "wsgi.wsgi", "requirements.txt", "/var/www/html/"]
RUN yum install httpd httpd-devel python3 python3-devel gcc -y; pip3 install -r /var/www/html/requirements.txt; mkdir /var/www/html/static; chown apache:apache /var/www/html/*
COPY templates/sample.html /var/www/html/templates/
COPY docker/py.conf /etc/httpd/conf.d/
COPY docker/httpd.conf /etc/httpd/conf/
CMD ["/usr/sbin/httpd", "-DFOREGROUND"]

Recommended Posts

Run with CentOS7 + Apache2.4 + Python3.6 for the time being
Use logger with Python for the time being
Python Master RTA for the time being
Until you can install blender and run it with python for the time being
Run yolov4 "for the time being" on windows
I played with Floydhub for the time being
See python for the first time
Until you run python with apache
Understanding the python class Struggle (1) Let's move it for the time being
CentOS 6.4 with Python 2.7.3 with Apache with mod_wsgi and Django
MongoDB for the first time in Python
Let's touch Google's Vision API from Python for the time being
For the time being, I want to convert files with ffmpeg !!
Try using FireBase Cloud Firestore in Python for the time being
Challenge image classification with TensorFlow2 + Keras CNN 1 ~ Move for the time being ~
[Python] [Machine learning] Beginners without any knowledge try machine learning for the time being
For the time being, import them into jupyter
Make a histogram for the time being (matplotlib)
I tried python programming for the first time.
Try using LINE Notify for the time being
Run Flask on CentOS with python3.4, Gunicorn + Nginx.
virtualenv For the time being, this is all!
Run Python with VBA
Run prepDE.py with python3
Run Blender with python
Run iperf with python
Turn multiple lists with a for statement at the same time in Python
What I got into Python for the first time
I tried Python on Mac for the first time.
Stop EC2 for specified time + start with Lambda (python)
[Python] Measures and displays the time required for processing
Molecular dynamics simulation to try for the time being
I tried python on heroku for the first time
Information for controlling the motor with Python on RaspberryPi
I will install Arch Linux for the time being.
Next to Excel, for the time being, jupyter notebook
Until you run a Flask application on Google App Engine for the time being
Write this in the ttl file for the time being for automatic SSH login with Teraterm
Kaggle for the first time (kaggle ①)
Run python with PyCharm (Windows)
Run Python with CloudFlash (arm926ej-s)
Let's run Excel with Python
Python3 + Django ~ Mac ~ with Apache
Execution time measurement with Python With
Kaguru for the first time
Run Label with tkinter [Python]
Call the API with python3.
Time synchronization (Windows) with Python
Run DHT22 with RasPi + Python
I want to move selenium for the time being [for mac]
I tried running PIFuHD on Windows for the time being
Run the intellisense of your own python library with VScode.
[Understand in the shortest time] Python basics for data analysis
Create a Twitter BOT with the GoogleAppEngine SDK for Python
[Introduction to Reinforcement Learning] Reinforcement learning to try moving for the time being
For the time being, try using the docomo chat dialogue API
I want to create a Dockerfile for the time being.
The first artificial intelligence. Tensorflow on CentOS7.0. Built separately for python3.5 series and python2.7 series with virtualenv.
Extract the xz file with python
The story of not being able to run pygame with pycharm
Make apache log csv with python