Skip to content

Commit

Permalink
Add wait-for
Browse files Browse the repository at this point in the history
  • Loading branch information
frafra committed Dec 29, 2022
1 parent 0317024 commit 7b58b58
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ FROM python:3.8

RUN apt-get -q -y update && \
DEBIAN_FRONTEND=noninteractive apt-get -yq install gettext-base
ADD https://raw.githubusercontent.com/eficode/wait-for/v2.2.3/wait-for /wait-for
RUN chmod +x /wait-for

RUN python3 -m pip install pdm

Expand All @@ -13,6 +15,7 @@ RUN pdm install --no-self --group prod
COPY coat2pycsw.py pycsw.conf.template entrypoint.sh .
COPY mappings/topics.yaml mappings/
ENV PYCSW_CONFIG=/app/pycsw.conf
ENV COAT_URL=https://data.coat.no/

EXPOSE 8000/TCP
ENTRYPOINT ["/bin/bash", "./entrypoint.sh"]
Expand Down
2 changes: 1 addition & 1 deletion coat2pycsw.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from pygeometa.schemas.iso19139 import ISO19139OutputSchema
from shapely.geometry import shape

URL = os.getenv("COAT_URL", "https://data.coat.no/")
URL = os.environ["COAT_URL"]


def get_datasets(url):
Expand Down
2 changes: 1 addition & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
set -xeuo pipefail

envsubst < pycsw.conf.template > pycsw.conf
pdm run python3 coat2pycsw.py
/wait-for "$COAT_URL" -- pdm run python3 coat2pycsw.py

exec "$@"

0 comments on commit 7b58b58

Please sign in to comment.