Skip to content

Commit

Permalink
URBIBBNA-42
Browse files Browse the repository at this point in the history
Simplify build and dependencies
  • Loading branch information
epam-vkerkhoff committed Jan 25, 2024
1 parent 0117c07 commit 56a887e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
16 changes: 9 additions & 7 deletions publish-barshare-gbfs/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
# This Dockerfile builds a service that regularly publishes the BARShare GBFS to the bbnavi open data portal.
FROM minio/mc as mc
FROM python:3-alpine

ENV MOQO_ACCESS_TOKEN=""
ENV MINIO_ACCESS_KEY="" MINIO_SECRET_KEY=""
ENV PUBLISH_INTERVAL=""
RUN apk add --no-cache --update tree minio-cli

RUN apk add --no-cache --update tree
WORKDIR /usr/src/app

# install MinIO client a.k.a. mc
COPY --from=mc /usr/bin/mc /usr/bin/mc
COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt

COPY main.sh ./
COPY index.html barshare-logo.png ./

ENV MOQO_ACCESS_TOKEN=""
ENV MINIO_ACCESS_KEY="" MINIO_SECRET_KEY=""
ENV PUBLISH_INTERVAL=""

# prevent inheriting `python` as entrypoint
ENTRYPOINT []

Expand Down
4 changes: 2 additions & 2 deletions publish-barshare-gbfs/main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ dir="$(mktemp -d -t barshare-gbfs.XXXXXX)"

set -x

mc cp -q index.html barshare-logo.png bbnavi/barshare/
mcli cp -q index.html barshare-logo.png bbnavi/barshare/

while true; do
# We sleep first so that, if the GBFS generation fails contantly, we don't DOS the Moqo API.
Expand All @@ -39,5 +39,5 @@ while true; do

tree -sh "$dir"

mc cp -q -r $dir/* bbnavi/barshare/
mcli cp -q -r $dir/* bbnavi/barshare/
done

0 comments on commit 56a887e

Please sign in to comment.