add: dockerfile

This commit is contained in:
Дмитрий Абдрахманов 2024-09-09 13:14:24 +03:00
parent bcafac3766
commit 37ee688096
2 changed files with 7 additions and 1 deletions

5
Dockerfile Normal file
View File

@ -0,0 +1,5 @@
FROM python:3.12.3-alpine
LABEL maintainer="565963@gmail.com"
WORKDIR /app
COPY ./src .
ENTRYPOINT ["/usr/local/bin/python", "main.py"]

View File

@ -1,6 +1,7 @@
from functools import cache
import urllib.request
@cache
def weather_handler(date: str):
print(date)
@ -13,4 +14,4 @@ def weather_handler(date: str):
+ "&current=temperature_2m,relative_humidity_2m,rain,snowfall,weather_code,wind_speed_10m,wind_direction_10m&hourly=temperature_2m,relative_humidity_2m,rain,snowfall,weather_code,wind_speed_10m,wind_direction_10m&timezone=Europe/Moscow&forecast_days=3"
)
raw_data = urllib.request.urlopen(url).read()
return raw_data
return raw_data