Step1:Create one git hub repository
step2:give production path
GCP_CREDENTIALS_JSON = "/opt/lampp/htdocs/motoshare.jp/motoshare-web/gcp-service.json"
step3: git clone repository
git clone git@github.com:Motosharein/motoshare_flask.git
Also install system dependencies in Linux server
sudo apt-get update
sudo apt-get install -y tesseract-ocr libtesseract-dev
Check binary path:
which tesseract
Should return:
/usr/bin/tesseract
Install python
specific version
sudo apt update
sudo apt install python3-pip -y
Check python version
python3 --version
apt install python3.12-venv
Use Python 3.12 safely (venv)
# Check 3.12 exists
which python3.12 || sudo apt install -y python3.12 python3.12-venv
# Create venv with 3.12
cd /opt/lampp/htdocs/motoshare_flask
python3.12 -m venv venv
source venv/bin/activate
# Verify you're inside the venv
which python
python --version
# Install deps inside the venv
pip install --upgrade pip
pip install -r requirements.txt
pip install gunicorn
# 4A) run with gunicorn (recommended)
gunicorn --bind 127.0.0.1:5000 "app:create_app()"
sudo apt install -y libgl1 libglib2.0-0 libsm6 libxext6 libxrender1
Notes
See what your module actually exposes
Run this in your project folder:
cd /opt/lampp/htdocs/motoshare.jp/motoshare_flask
source venv/bin/activate
python -c "import app; print('attrs:', [a for a in dir(app) if a in ('app','application','create_app')])"
Virtual host setup
http_vhost
<VirtualHost *:80>
ServerName motoshare.jp
ServerAlias www.motoshare.jp
DocumentRoot "/opt/lampp/htdocs/motoshare.jp/motoshare-web/public"
# ...your existing Directory + Alias blocks...
# --- Proxy /image/* to Flask on localhost:5000 ---
ProxyRequests Off
ProxyPreserveHost On
# Put these BEFORE any other ProxyPass lines; keep trailing slashes
ProxyPass /image/ http://127.0.0.1:5000/image/
ProxyPassReverse /image/ http://127.0.0.1:5000/image/
# No X-Forwarded-Prefix or Location rewrites (prevents double prefix)
ProxyTimeout 120
Timeout 120
</VirtualHost>
httpd-ssl.conf
<VirtualHost *:443>
ServerName motoshare.jp
ServerAlias www.motoshare.jp
DocumentRoot "/opt/lampp/htdocs/motoshare.jp/motoshare-web/public"
SSLEngine On
SSLCertificateFile "/opt/lampp/etc/certs/motoshare.jp/motoshare.jp.cer"
SSLCertificateKeyFile "/opt/lampp/etc/certs/motoshare.jp/motoshare.jp.key"
SSLCACertificateFile "/opt/lampp/etc/certs/motoshare.jp/fullchain.cer"
# ...your existing Directory + Alias blocks...
# --- Proxy /image/* to Flask on localhost:5000 ---
ProxyRequests Off
ProxyPreserveHost On
ProxyPass /image/ http://127.0.0.1:5000/image/
ProxyPassReverse /image/ http://127.0.0.1:5000/image/
ProxyTimeout 120
Timeout 120
</VirtualHost>
finally check:
https://motoshare.jp/imageverify/
Top comments (0)