From c811af252a46010dccae5c5778d64c45cf47d332 Mon Sep 17 00:00:00 2001 From: Sam Chudnick Date: Sat, 10 Jun 2023 07:30:48 -0400 Subject: Added docker components and README. --- Dockerfile | 32 ++++++++++++++++++++++++++++++++ README.md | 23 +++++++++++++++++++++++ src/run.sh | 2 +- 3 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 Dockerfile create mode 100644 README.md diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..e1f4b9a --- /dev/null +++ b/Dockerfile @@ -0,0 +1,32 @@ +FROM debian:bullseye + +EXPOSE 8000 + +WORKDIR /app + +COPY src ./src + +RUN apt update -y && apt install -y \ + python3-tz \ + python3-flask \ + python3-flaskext.wtf \ + python3-requests \ + python3-wtforms \ + && apt clean \ + && rm -rf /var/cache/apt + +ENTRYPOINT ["/app/src/run.sh"] + +LABEL maintainer="searxng <${GIT_URL}>" \ + description="Weather Application" \ + version="0.1" \ + org.label-schema.schema-version="1.0" \ + org.label-schema.name="pywttr" \ + org.label-schema.version="0.1" \ + org.label-schema.url="https://gitea.chudnick.com/sam/pywttr" \ + org.opencontainers.image.title="pywttr" \ + org.opencontainers.image.version="0.1" \ + org.opencontainers.image.url="https://gitea.chudnick.com/sam/pywttr" \ + org.opencontainers.image.revision="0.1" \ + org.opencontainers.image.source="https://gitea.chudnick.com/sam/pywttr" \ + org.opencontainers.image.documentation="https://gitea.chudnick.com/sam/pywttr" \ diff --git a/README.md b/README.md new file mode 100644 index 0000000..a658b10 --- /dev/null +++ b/README.md @@ -0,0 +1,23 @@ +# pywttr-docker + +pywttr-docker is a lightweight docker web application for getting +weather information from any location in the world. + +The application uses the FOSS Open-Meteo API to retrieve this information +without any API key or paid subscriptions to services like OpenWeatherMap. + +# setup + +## clone the repository +``` +git clone https://git.chudnick.com/pywttr-docker +``` +## build the image +``` +docker build -t pywttr:latest pywttr-docker/Dockerfile +``` +## run the container +``` +docker run -d -p 8000:8000 --name pywttr pywttr:latest +``` + diff --git a/src/run.sh b/src/run.sh index 0d36b89..282c615 100755 --- a/src/run.sh +++ b/src/run.sh @@ -1,2 +1,2 @@ #!/bin/sh -flask run +FLASK_APP=/app/src/app.py flask run -p 8000 -h "0.0.0.0" -- cgit v1.2.3