From 35e444dd75746968413bc83fba774e9fbf67bfcb Mon Sep 17 00:00:00 2001 From: Tom Kralidis Date: Tue, 19 Mar 2024 07:16:26 -0400 Subject: [PATCH] harmonize Docker setups --- docker-compose.yml | 11 +++++++++++ wis2-gdc-api/Dockerfile | 13 +++++++------ wis2-gdc-api/{ => docker}/entrypoint.sh | 0 wis2-gdc-api/{ => docker}/wis2-gdc-api.yml | 0 wis2-gdc-api/requirements.txt | 2 +- wis2-gdc-broker/Dockerfile | 6 +++--- wis2-gdc-broker/{ => docker}/acl.conf | 0 wis2-gdc-broker/{ => docker}/entrypoint.sh | 0 wis2-gdc-broker/{ => docker}/mosquitto.conf | 0 wis2-gdc-management/Dockerfile | 2 +- wis2-gdc-metrics-collector/Dockerfile | 4 +++- 11 files changed, 26 insertions(+), 12 deletions(-) rename wis2-gdc-api/{ => docker}/entrypoint.sh (100%) rename wis2-gdc-api/{ => docker}/wis2-gdc-api.yml (100%) rename wis2-gdc-broker/{ => docker}/acl.conf (100%) rename wis2-gdc-broker/{ => docker}/entrypoint.sh (100%) rename wis2-gdc-broker/{ => docker}/mosquitto.conf (100%) diff --git a/docker-compose.yml b/docker-compose.yml index 6fc3cde..72842b4 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -72,6 +72,17 @@ services: depends_on: - wis2-gdc-broker + prometheus: + container_name: prometheus + image: prom/prometheus + volumes: + - "./prometheus.yml:/etc/prometheus/prometheus.yml" + networks: + - wis2-gdc-net + ports: + - 9090:9090 + + wis2-gdc-management: container_name: wis2-gdc-management build: diff --git a/wis2-gdc-api/Dockerfile b/wis2-gdc-api/Dockerfile index 95b123f..b9d1b06 100644 --- a/wis2-gdc-api/Dockerfile +++ b/wis2-gdc-api/Dockerfile @@ -27,14 +27,15 @@ ENV PYGEOAPI_CONFIG=/pygeoapi/local.config.yml ENV PYGEOAPI_OPENAPI=/pygeoapi/local.openapi.yml RUN apt-get update && \ - apt-get install -y curl && \ - pip3 install -r requirements.txt && \ - pywcmp bundle sync + apt-get install -y curl -COPY ./wis2-gdc-api.yml /pygeoapi/local.config.yml COPY ./app.py /pygeoapi/pygeoapi/app.py -COPY ./entrypoint.sh /app/docker/wis2-gdc-api/entrypoint.sh +COPY ./docker/wis2-gdc-api.yml /pygeoapi/local.config.yml +COPY ./requirements.txt /app/docker/wis2-gdc-api/requirements.txt +COPY ./docker/entrypoint.sh /app/docker/wis2-gdc-api/entrypoint.sh -RUN chmod +x /app/docker/wis2-gdc-api/entrypoint.sh +RUN pip3 install -r /app/docker/wis2-gdc-api/requirements.txt && \ + pywcmp bundle sync && \ + chmod +x /app/docker/wis2-gdc-api/entrypoint.sh ENTRYPOINT [ "/app/docker/wis2-gdc-api/entrypoint.sh" ] diff --git a/wis2-gdc-api/entrypoint.sh b/wis2-gdc-api/docker/entrypoint.sh similarity index 100% rename from wis2-gdc-api/entrypoint.sh rename to wis2-gdc-api/docker/entrypoint.sh diff --git a/wis2-gdc-api/wis2-gdc-api.yml b/wis2-gdc-api/docker/wis2-gdc-api.yml similarity index 100% rename from wis2-gdc-api/wis2-gdc-api.yml rename to wis2-gdc-api/docker/wis2-gdc-api.yml diff --git a/wis2-gdc-api/requirements.txt b/wis2-gdc-api/requirements.txt index dc457db..6b8fb9f 100644 --- a/wis2-gdc-api/requirements.txt +++ b/wis2-gdc-api/requirements.txt @@ -1,2 +1,2 @@ -pywis-pubsub +pywcmp requests diff --git a/wis2-gdc-broker/Dockerfile b/wis2-gdc-broker/Dockerfile index 71a88e9..ed353c7 100644 --- a/wis2-gdc-broker/Dockerfile +++ b/wis2-gdc-broker/Dockerfile @@ -21,8 +21,8 @@ FROM eclipse-mosquitto:latest -COPY mosquitto.conf /mosquitto/config/mosquitto.conf -COPY acl.conf /mosquitto/config/acl.conf -COPY entrypoint.sh /docker-entrypoint.sh +COPY ./docker/mosquitto.conf /mosquitto/config/mosquitto.conf +COPY ./docker/acl.conf /mosquitto/config/acl.conf +COPY ./docker/entrypoint.sh /docker-entrypoint.sh RUN chmod +x /docker-entrypoint.sh diff --git a/wis2-gdc-broker/acl.conf b/wis2-gdc-broker/docker/acl.conf similarity index 100% rename from wis2-gdc-broker/acl.conf rename to wis2-gdc-broker/docker/acl.conf diff --git a/wis2-gdc-broker/entrypoint.sh b/wis2-gdc-broker/docker/entrypoint.sh similarity index 100% rename from wis2-gdc-broker/entrypoint.sh rename to wis2-gdc-broker/docker/entrypoint.sh diff --git a/wis2-gdc-broker/mosquitto.conf b/wis2-gdc-broker/docker/mosquitto.conf similarity index 100% rename from wis2-gdc-broker/mosquitto.conf rename to wis2-gdc-broker/docker/mosquitto.conf diff --git a/wis2-gdc-management/Dockerfile b/wis2-gdc-management/Dockerfile index 0fecc49..2340c81 100644 --- a/wis2-gdc-management/Dockerfile +++ b/wis2-gdc-management/Dockerfile @@ -28,7 +28,7 @@ ENV TZ="Etc/UTC" \ DEBIAN_PACKAGES="bash cron curl git python3-pip python3-setuptools vim" # copy the app -COPY . /app +COPY ./ /app # add to crontab COPY ./docker/wis2-gdc-management.cron /etc/cron.d/wis2-gdc-management.cron diff --git a/wis2-gdc-metrics-collector/Dockerfile b/wis2-gdc-metrics-collector/Dockerfile index 1919fb6..87d4511 100644 --- a/wis2-gdc-metrics-collector/Dockerfile +++ b/wis2-gdc-metrics-collector/Dockerfile @@ -21,7 +21,9 @@ FROM python:3-alpine -COPY . /app +COPY ./metrics_collector.py /app/metrics_collector.py +COPY ./requirements.txt /app/requirements.txt + RUN pip install -r /app/requirements.txt ENV PYTHONUNBUFFERED="true"