diff --git a/Dockerfile b/Dockerfile index c7d2060..bd617f9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,7 @@ FROM python:3-alpine -COPY . /opt +RUN adduser -D -u 1000 pyuser WORKDIR /opt +COPY --chown=1000:1000 . /opt +USER pyuser RUN pip install -r requirements.txt ENTRYPOINT ["python", "server.py"] diff --git a/requirements.txt b/requirements.txt index 8c49719..4928075 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,3 @@ -aniso8601==9.0.1 blinker==1.7.0 certifi==2024.2.2 charset-normalizer==3.3.2 diff --git a/server.py b/server.py index 27fc758..f1cae7b 100644 --- a/server.py +++ b/server.py @@ -37,7 +37,7 @@ def main(): elif os.getenv("CURRENT_CITY"): city = os.getenv("CURRENT_CITY") else: - city = "Sofia" + city = "NA" app = create_app(city) serve(app, host="0.0.0.0", port=8000) diff --git a/weather.py b/weather.py index edef899..9cc4102 100644 --- a/weather.py +++ b/weather.py @@ -14,7 +14,8 @@ def get_current_weather(city="Sofia"): def main(): - city: str = os.getenv("CURRENT_CITY", "Sofia") + city: str = os.getenv("CURRENT_CITY") if os.getenv("CURRENT_CITY") else "NA" + # city: str = os.getenv("CURRENT_CITY") weather_data = get_current_weather(city) print("\n")