diff --git a/requirements.txt b/requirements.txt index 24d040a..5b4b789 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,6 +2,6 @@ pyTelegramBotAPI~=4.5.0 python-dotenv~=0.20.0 APScheduler~=3.9.1 SQLAlchemy~=1.4.36 -mysqlclient~=1.4.6 +pymysql==1.0.2 requests~=2.27.1 beautifulsoup4~=4.9.1 \ No newline at end of file diff --git a/source/.env.example b/source/.env.example index aa882c0..d9f160a 100644 --- a/source/.env.example +++ b/source/.env.example @@ -2,4 +2,4 @@ BOT_API_KEY= # Database -DATABASE_CONNECTION=mysql://scott:tiger@localhost/foo \ No newline at end of file +DATABASE_CONNECTION=mysql+pymysql://scott:tiger@localhost/foo \ No newline at end of file diff --git a/source/Dockerfile b/source/Dockerfile new file mode 100644 index 0000000..1ef23c2 --- /dev/null +++ b/source/Dockerfile @@ -0,0 +1,17 @@ +FROM python:3.10-slim + +# Change the working directory to the root of the project +WORKDIR /srv/flask_app + +# Install the dependencies +COPY requirements.txt /srv/flask_app/ +RUN pip install -r requirements.txt --src /usr/local/src --no-warn-script-location + +# Copy the source code to the working directory +COPY source /srv/flask_app + +# Change file permissions +RUN chmod +x ./deploy/start.sh + +# Run the app +CMD ["./deploy/start.sh"] \ No newline at end of file diff --git a/source/deploy/start.sh b/source/deploy/start.sh new file mode 100644 index 0000000..05cc58f --- /dev/null +++ b/source/deploy/start.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env sh + +python bot.py