Skip to content

Commit

Permalink
New versions of libraries.
Browse files Browse the repository at this point in the history
  • Loading branch information
richie256 committed Jan 1, 2024
1 parent db7087b commit d359807
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 35 deletions.
3 changes: 3 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 2 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
FROM python:3
#FROM python:3-onbuild
FROM python:3.12

ARG TARGETPLATFORM
ENV TARGETPLATFORM=${TARGETPLATFORM}
Expand All @@ -8,10 +7,9 @@ RUN echo "I'm building for $TARGETPLATFORM"
COPY . /usr/src/app
WORKDIR /usr/src/app
ENV TZ=America/Montreal
# RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && dpkg-reconfigure -f noninteractive tzdata

RUN echo "pandas==0.25.3" >> requirements.txt
RUN echo "pandas==2.1.4" >> requirements.txt

RUN pip install --no-cache-dir -r requirements.txt

Expand Down
13 changes: 1 addition & 12 deletions Dockerfile.aarch64
Original file line number Diff line number Diff line change
@@ -1,18 +1,12 @@
FROM multiarch/qemu-user-static:x86_64-aarch64 as qemu

FROM arm64v8/python:3.7-alpine


FROM arm64v8/python:3.12-alpine

COPY --from=qemu /usr/bin/qemu-aarch64-static /usr/bin

ARG TARGETPLATFORM
RUN echo "I'm building for $TARGETPLATFORM"

# FROM python:3
#FROM python:3-onbuild

#FROM python:3.7.2-alpine3.9
RUN apk add --no-cache python3-dev libstdc++ && \
apk add --no-cache g++ && \
ln -s /usr/include/locale.h /usr/include/xlocale.h && \
Expand All @@ -22,11 +16,6 @@ RUN apk add --no-cache python3-dev libstdc++ && \
COPY . /usr/src/app
WORKDIR /usr/src/app

#RUN apt-get install python3-pandas
#RUN echo "http://dl-8.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories \
# && apk update \
# && apk add py3-numpy py3-pandas

RUN pip install --no-cache-dir -r requirements.txt

ENV TZ=America/Montreal
Expand Down
13 changes: 1 addition & 12 deletions Dockerfile.armhf
Original file line number Diff line number Diff line change
@@ -1,18 +1,12 @@
FROM multiarch/qemu-user-static:x86_64-arm as qemu
FROM arm32v7/python:3.7-alpine

FROM arm32v7/python:3.12-alpine

COPY --from=qemu /usr/bin/qemu-arm-static /usr/bin

ARG TARGETPLATFORM
RUN echo "I'm building for $TARGETPLATFORM"



# FROM python:3
#FROM python:3-onbuild

#FROM python:3.7.2-alpine3.9
RUN apk add --no-cache python3-dev libstdc++ && \
apk add --no-cache g++ && \
ln -s /usr/include/locale.h /usr/include/xlocale.h && \
Expand All @@ -22,11 +16,6 @@ RUN apk add --no-cache python3-dev libstdc++ && \
COPY . /usr/src/app
WORKDIR /usr/src/app

#RUN apt-get install python3-pandas
#RUN echo "http://dl-8.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories \
# && apk update \
# && apk add py3-numpy py3-pandas

RUN pip install --no-cache-dir -r requirements.txt

ENV TZ=America/Montreal
Expand Down
27 changes: 21 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Return the time and info of the next bus for a giving bus-stop of the RTL.
- [x] Add 24h expiration for the zip file.
- [x] Add MQTT functionality.
- [ ] Observed a problem with current datetime in Docker Raspberry Pi.
- [ ] Create light mode for Raspberry Pi-friendly.
- [ ] Create lite mode for Raspberry Pi-friendly.
- [ ] Indicate how to find a stop code.
- [ ] Sometimes, the rage of date in the file `calendar.txt` in the current zip file is in the future.

Expand All @@ -40,7 +40,7 @@ The architectures supported by this image are:
```
docker run -d \
--name=rtl-schedule \
-p <EXTERNAL_PORT>:80 \
-e 80:80 \
--restart unless-stopped \
richie256/rtl-schedule
```
Expand All @@ -49,10 +49,10 @@ docker run -d \

Refer to the following table for parameters available to the container images:

| Parameter | Required | Description |
| :----: | --- | --- |
| `-e RTL_MODE=<mode>` | | Supported mode: JSON for JSON MS, MQTT. |
| `-p <EXTERNAL_PORT>:80` | <div align="center">✔</div> | Publish the container's `80` internal port to the host as `<EXTERNAL_PORT>`. |
| Parameter | Required | Description |
|:---------------------:| --- | --- |
| `-e RTL_MODE=<mode>` | | Supported mode: JSON for JSON MS, MQTT. |
| `-e EXTERNAL_PORT:80` | <div align="center">✔</div> | Publish the container's `80` internal port to the host as `EXTERNAL_PORT`. |


### How to call the application
Expand All @@ -66,6 +66,21 @@ Command line parameters:
| `<STOP_CODE>` | Your desired stop code.


# Build locally

Build
``` bash
docker build -t rtl-schedule:local .
```

``` bash
docker run -d \
--name=rtl-schedule \
-p <EXTERNAL_PORT>:80 \
--restart unless-stopped \
rtl-schedule:local
```

# MQTT DAEMON

Here is all the environment variables required if you use the MQTT output.
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Flask==2.3.2
flask-restful==0.3.6
flask-restful==0.3.10
requests==2.31.0
paho-mqtt==1.5.0

0 comments on commit d359807

Please sign in to comment.