Skip to content

Commit

Permalink
Run as pyuser
Browse files Browse the repository at this point in the history
  • Loading branch information
Georgi Kostadinov committed Mar 27, 2024
1 parent a0dbf1f commit b97f600
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
aniso8601==9.0.1
blinker==1.7.0
certifi==2024.2.2
charset-normalizer==3.3.2
Expand Down
2 changes: 1 addition & 1 deletion server.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion weather.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit b97f600

Please sign in to comment.