Dockerized and fixed errors
This commit is contained in:
		
							
								
								
									
										12
									
								
								Dockerfile
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								Dockerfile
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,12 @@ | ||||
| FROM python:3.10-buster | ||||
|  | ||||
|  | ||||
| RUN mkdir -p /app | ||||
| COPY requirements.txt /app/ | ||||
| RUN python3 -m pip install --upgrade pip && python3 -m pip install -r /app/requirements.txt | ||||
|  | ||||
| COPY app/ /app/ | ||||
| WORKDIR /app/ | ||||
| ENV containterized true | ||||
|  | ||||
| CMD ["python3", "server.py"] | ||||
							
								
								
									
										12
									
								
								app/bot/api/__init__.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								app/bot/api/__init__.py
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,12 @@ | ||||
| from . import reddit | ||||
| from . import weather | ||||
| from . import reddit | ||||
| from . import search | ||||
| from . import metmuseum | ||||
| import os | ||||
| if os.getenv("dockerized", "") == "true": | ||||
|     import sys | ||||
|     sys.path.append("/keys") | ||||
|     import api_keys as keys | ||||
| else: | ||||
|     from . import keys | ||||
| @@ -66,4 +66,4 @@ class ChatBot(): | ||||
|         self.telegram.start_polling( | ||||
|             poll_interval=0.2, | ||||
|         ) | ||||
|         # self.telegram.idle() | ||||
|         self.telegram.idle() | ||||
| Before Width: | Height: | Size: 9.1 KiB After Width: | Height: | Size: 9.1 KiB | 
| @@ -7,8 +7,14 @@ import logging | ||||
| logger = logging.getLogger(__name__) | ||||
| 
 | ||||
| 
 | ||||
| from . import keys | ||||
| dbk = keys.db_keys | ||||
| import os | ||||
| if os.getenv("dockerized", "") == "true": | ||||
|     import sys | ||||
|     sys.path.append("/keys") | ||||
|     import db_keys as keys | ||||
| else: | ||||
|     from . import keys | ||||
| dbk = keys.db_access | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| @@ -8,8 +8,8 @@ import logging | ||||
| import platform | ||||
| 
 | ||||
| 
 | ||||
| if platform.uname().node == "ArchSpectre": | ||||
|     # development | ||||
| import os | ||||
| if os.getenv("dockerized", "") == "true" or platform.uname().node == "ArchSpectre": | ||||
|     logging.basicConfig( | ||||
|         format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', level=logging.INFO | ||||
|     ) | ||||
| @@ -1,6 +0,0 @@ | ||||
| from . import keys | ||||
| from . import reddit | ||||
| from . import weather | ||||
| from . import reddit | ||||
| from . import search | ||||
| from . import metmuseum | ||||
							
								
								
									
										
											BIN
										
									
								
								requirements.txt
									
									
									
									
									
								
							
							
						
						
									
										
											BIN
										
									
								
								requirements.txt
									
									
									
									
									
								
							
										
											Binary file not shown.
										
									
								
							
		Reference in New Issue
	
	Block a user
	 Remy Moll
					Remy Moll