Добавил поддержку Docker
This commit is contained in:
		
							
								
								
									
										28
									
								
								Dockerfile
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										28
									
								
								Dockerfile
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,28 @@
 | 
			
		||||
FROM python:3.11.2-alpine3.17
 | 
			
		||||
 | 
			
		||||
LABEL Maintainer="serega404"
 | 
			
		||||
 | 
			
		||||
ENV MUSL_LOCALE_DEPS cmake make musl-dev gcc gettext-dev libintl
 | 
			
		||||
ENV MUSL_LOCPATH /usr/share/i18n/locales/musl
 | 
			
		||||
 | 
			
		||||
RUN apk add --no-cache \
 | 
			
		||||
    $MUSL_LOCALE_DEPS \
 | 
			
		||||
    && wget https://gitlab.com/rilian-la-te/musl-locales/-/archive/master/musl-locales-master.zip \
 | 
			
		||||
    && unzip musl-locales-master.zip \
 | 
			
		||||
      && cd musl-locales-master \
 | 
			
		||||
      && cmake -DLOCALE_PROFILE=OFF -D CMAKE_INSTALL_PREFIX:PATH=/usr . && make && make install \
 | 
			
		||||
      && cd .. && rm -r musl-locales-master
 | 
			
		||||
 | 
			
		||||
WORKDIR /app
 | 
			
		||||
 | 
			
		||||
COPY requirements.txt requirements.txt
 | 
			
		||||
RUN pip3 install -r requirements.txt
 | 
			
		||||
 | 
			
		||||
# Setting up crontab
 | 
			
		||||
COPY crontab /tmp/crontab
 | 
			
		||||
RUN cat /tmp/crontab > /etc/crontabs/root
 | 
			
		||||
 | 
			
		||||
COPY main.py main.py
 | 
			
		||||
 | 
			
		||||
# run crond as main process of container
 | 
			
		||||
CMD ["crond", "-f", "-l", "2"]
 | 
			
		||||
							
								
								
									
										2
									
								
								crontab
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										2
									
								
								crontab
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,2 @@
 | 
			
		||||
@reboot cd /app && python3 /app/main.py 
 | 
			
		||||
0 */6 * * *  cd /app && python3 /app/main.py 
 | 
			
		||||
							
								
								
									
										2
									
								
								main.py
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								main.py
									
									
									
									
									
								
							@@ -33,6 +33,7 @@ else:
 | 
			
		||||
                "url": url,
 | 
			
		||||
                "imageUrl": imamgeurl 
 | 
			
		||||
            }
 | 
			
		||||
            print("КиноНЕО | Найден фильм: " + title.text)
 | 
			
		||||
            elements.append(jsonout)
 | 
			
		||||
 | 
			
		||||
headers = {"X-Platform": "widget", "X-Application-Token": "KMwvMv7qwz4IVNMu48cTot3PBNnYrifO"}
 | 
			
		||||
@@ -55,6 +56,7 @@ else:
 | 
			
		||||
              "url": "https://kinocharly.ru/51/release/" + str(release["id"]) + "?date=" + curDate,
 | 
			
		||||
              "imageUrl": release["poster"] 
 | 
			
		||||
            }
 | 
			
		||||
            print("Чарли | Найден фильм: " + release["title"])
 | 
			
		||||
            elements.append(json)
 | 
			
		||||
 | 
			
		||||
request = requests.post(API_URL, json = elements)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user