Refactgor

This commit is contained in:
Piotr Biernat 2024-07-20 13:30:27 +02:00
parent 9e1387d680
commit 2671dde183
7 changed files with 19 additions and 14 deletions

View File

@ -7,12 +7,13 @@ LABEL dev.egommerce.image.version="1.0"
COPY ./api-eventbus/etc /etc/rabbitmq
COPY ./api-eventbus/entrypoint.sh ./api-eventbus/wait-for-it.sh /
COPY ./.app.config /
RUN rabbitmq-plugins --offline enable rabbitmq_peer_discovery_consul rabbitmq_prometheus && \
chmod 755 /entrypoint.sh
# rabbitmq-plugins --offline enable rabbitmq_prometheus && \
# RUN rabbitmq-plugins enable --offline rabbitmq_prometheus
EXPOSE 5672
ENTRYPOINT ["/entrypoint.sh"]
CMD ["rabbitmq-server"]
HEALTHCHECK --interval=5s --timeout=1s --retries=20 CMD rabbitmq-diagnostics -q ping >/dev/null || exit 1

View File

@ -8,5 +8,8 @@ build-image-dev:
build-image-prod:
- sh ${DEPLOY_DIR}/image-build.sh
push-image-dev:
- sh ${DEPLOY_DIR}/image-push.sh dev
push-image-prod:
- sh ${DEPLOY_DIR}/image-push.sh

View File

@ -1,6 +1,8 @@
#!/usr/bin/env sh
set +e
update-resolv
waitForService()
{
./wait-for-it.sh $1 -t 2 1>/dev/null 2>&1
@ -15,8 +17,11 @@ waitForService()
}
waitForService "api-registry:8500"
# waitForService "logger.service.ego.io:24224"
waitForService "api-logger:24224"
set -euo pipefail
register-service
exec "$@"

View File

@ -1 +1 @@
prometheus.tcp.port = 8084
# prometheus.tcp.port = 8084

View File

@ -1,7 +0,0 @@
cluster_formation.peer_discovery_backend = consul
cluster_formation.consul.host = api-registry
cluster_formation.consul.svc_addr_auto = false
cluster_formation.consul.svc = api-eventbus
cluster_formation.consul.svc_addr = api-eventbus

View File

@ -1,7 +1,7 @@
#!/bin/sh
# RUN IN REPO ROOT DIR !!
export IMAGE_NAME="git.pbiernat.dev/egommerce/api-eventbus"
export IMAGE_NAME="git.pbiernat.io/egommerce/api-eventbus"
TARGET=${1:-latest}

View File

@ -1,9 +1,12 @@
#!/bin/sh
# RUN IN REPO ROOT DIR !!
export IMAGE_NAME="git.pbiernat.dev/egommerce/api-eventbus"
export IMAGE_NAME="git.pbiernat.io/egommerce/api-eventbus"
TARGET=${1:-latest}
echo $DOCKER_PASSWORD | docker login git.pbiernat.dev -u $DOCKER_USERNAME --password-stdin
echo $DOCKER_PASSWORD | docker login git.pbiernat.io -u $DOCKER_USERNAME --password-stdin
docker push "$IMAGE_NAME:$TARGET"
# Restart container
curl -X POST http://127.0.0.1:9001/api/webhooks/2d456377-d438-4617-88fc-8d06657e4f45