1. This is the first time to upload a project here. Sorry for the bugs. Environment variables are not set in .env file or other places, which will be fixed in the future.
2. This project is aimed to help beginners of Python, Flask or Docker to deploy their linebot on any VPS like DigitalOcean, Linode, or Vultr according to several people.
https://github.com/howarder3/GPT-Linebot-python-flask-on-vercel
Step 0: You can get free DNS hostname service like noip. After signing up, you just type in your VPS ip and choose your own URL address with only one-month confirmation.
make do1
echo 'export LC_ALL=C.UTF-8' >> ~/.bashrc
echo 'export LANG=C.UTF-8' >> ~/.bashrc
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc
echo 'export PATH="$PYENV_ROOT/shims:$PATH"' >> ~/.bashrc
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc
echo -e 'if command -v pyenv 1>/dev/null 2>&1; then\n eval "$(pyenv init -)"\nfi' >> ~/.bashrc
exec $SHELL
make do2
Step 4: Build Auto-SSL Nginx service according to https://github.com/evertramos/nginx-proxy-automation 。However, there is something wrong with the current commit, so you can use the version of 2022/10/24 commit.
2022/10/24 https://github.com/evertramos/nginx-proxy-automation/tree/5b66f76f29a58f2928e6b1092c66869466a11146
git clone --recurse-submodules https://github.com/evertramos/nginx-proxy-automation.git proxy
Step 5: Please start the certified SSL service with the following command. Please change your_email@domain into your registered email on websites like noip. After that, there will be three containers running. You can type in docker ps -a to confirm that.
cd proxy/bin && ./fresh-start.sh --yes -e your_email@domain --skip-docker-image-check
Step 6: type in cd ~ , and go back to the root folder. Type in the following command to download the project.
git clone https://github.com/pyfbsdk59/Flask-ChatGPT-linebot-docker-SSL.git
Step 7: Type in the following command to get into the folder of this project, which contains a Makefile. There should be two folders called "proxy" and "Flask-ChatGPT-linebot-docker-SSL".
cd Flask-ChatGPT-linebot-docker-SSL
Step 8: Please type in the following command and start to build the containers of the project. There will be one container running which represents Nginx and Flask service. Remember to edit the main.py inside the folder of app/. Please add your LINE channel access token and channel secret to the file. You should also edit the same file and add the api key of OPENAPI service. The docker-compose.yml file should also be edited. VIRTUAL_HOST and LETSENCRYPT_HOST will be your linebot service URL. LETSENCRYPT_EMAIL will be your DNS service like noip registered email.
make dcup