From 37ee68809644764d0028f1b80d92a50475d50db8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=BC=D0=B8=D1=82=D1=80=D0=B8=D0=B9=20=D0=90=D0=B1?= =?UTF-8?q?=D0=B4=D1=80=D0=B0=D1=85=D0=BC=D0=B0=D0=BD=D0=BE=D0=B2?= <565963@gmail.com> Date: Mon, 9 Sep 2024 13:14:24 +0300 Subject: [PATCH] add: dockerfile --- Dockerfile | 5 +++++ src/weather.py | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..140d2e3 --- /dev/null +++ b/Dockerfile @@ -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"] \ No newline at end of file diff --git a/src/weather.py b/src/weather.py index 0769767..65276f2 100644 --- a/src/weather.py +++ b/src/weather.py @@ -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): + "¤t=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 \ No newline at end of file + return raw_data