diff --git a/apps/authentication/Dockerfile b/apps/authentication/Dockerfile index 9b05c5c..1439b4b 100644 --- a/apps/authentication/Dockerfile +++ b/apps/authentication/Dockerfile @@ -17,8 +17,6 @@ ENV MONGODB_NAME=freeleaps2 ENV MONGODB_PORT=27017 ENV MONGODB_URI="mongodb://localhost:27017/" - - #log_settings ENV LOG_BASE_PATH=$CONTAINER_APP_ROOT/log/$APP_NAME ENV BACKEND_LOG_FILE_NAME=$APP_NAME @@ -33,16 +31,6 @@ RUN pip install --no-cache-dir -r requirements.txt COPY . ${CONTAINER_APP_ROOT} -# Install tools and keyring updates -RUN apt-get update && apt-get install -y --no-install-recommends \ - gnupg wget && \ - apt-get install -y debian-keyring debian-archive-keyring && \ - rm -rf /var/lib/apt/lists/* - -# Install additional tools and create symbolic links -RUN apt-get update && apt-get install -y netcat && \ - ln -s /bin/bash /usr/bin/bash && \ - rm -rf /var/lib/apt/lists/* - EXPOSE ${SERVICE_API_ACCESS_PORT} -CMD ["uvicorn", "webapi.main:app", "--reload", "--port=${SERVICE_API_ACCESS_PORT}", "--host=${SERVICE_API_ACCESS_HOST}"] +# Using shell to expand environemnt to enure pass the actual environment value to uvicorn +CMD uvicorn webapi.main:app --reload --port=$SERVICE_API_ACCESS_PORT --host=$SERVICE_API_ACCESS_HOST \ No newline at end of file diff --git a/apps/central_storage/Dockerfile b/apps/central_storage/Dockerfile index 0f59f09..fbf07c1 100644 --- a/apps/central_storage/Dockerfile +++ b/apps/central_storage/Dockerfile @@ -30,9 +30,10 @@ RUN pip install --no-cache-dir -r requirements.txt COPY . ${CONTAINER_APP_ROOT} -RUN apt update -RUN apt install -y netcat -RUN ln -s /bin/bash /usr/bin/bash +#RUN apt update +#RUN apt install -y netcat +#RUN ln -s /bin/bash /usr/bin/bash EXPOSE ${SERVICE_API_ACCESS_PORT} -CMD ["uvicorn", "webapi.main:app", "--reload", "--port=${SERVICE_API_ACCESS_PORT}", "--host=${SERVICE_API_ACCESS_HOST}"] +# Using shell to expand environemnt to enure pass the actual environment value to uvicorn +CMD uvicorn webapi.main:app --reload --port=$SERVICE_API_ACCESS_PORT --host=$SERVICE_API_ACCESS_HOST diff --git a/apps/content/Dockerfile b/apps/content/Dockerfile index bc442b7..bfad1fd 100644 --- a/apps/content/Dockerfile +++ b/apps/content/Dockerfile @@ -30,9 +30,10 @@ RUN pip install --no-cache-dir -r requirements.txt COPY . ${CONTAINER_APP_ROOT} -RUN apt update -RUN apt install -y netcat -RUN ln -s /bin/bash /usr/bin/bash +#RUN apt update +#RUN apt install -y netcat +#RUN ln -s /bin/bash /usr/bin/bash EXPOSE ${SERVICE_API_ACCESS_PORT} -CMD ["uvicorn", "webapi.main:app", "--reload", "--port=${SERVICE_API_ACCESS_PORT}", "--host=${SERVICE_API_ACCESS_HOST}"] +# Using shell to expand environemnt to enure pass the actual environment value to uvicorn +CMD uvicorn webapi.main:app --reload --port=$SERVICE_API_ACCESS_PORT --host=$SERVICE_API_ACCESS_HOST \ No newline at end of file diff --git a/apps/notification/Dockerfile b/apps/notification/Dockerfile index 4973096..b246de3 100644 --- a/apps/notification/Dockerfile +++ b/apps/notification/Dockerfile @@ -4,8 +4,6 @@ FROM python:3.10-slim-buster ARG CONTAINER_APP_ROOT=/app ENV APP_NAME=notification - -#site_settings ENV SERVICE_API_ACCESS_HOST=0.0.0.0 ENV SERVICE_API_ACCESS_PORT=8003 ENV RABBITMQ_HOST=localhost @@ -22,14 +20,11 @@ ENV SENDGRID_API_KEY=SG.OrxsRI0IRaOxkd7xTfb8SA.J8CfOXsJy3vrJgTubbLmZOR6ii7z7m7C9 ENV TWILIO_ACCOUNT_SID=ACf8c9283a6acda060258eadb29be58bc8 ENV TWILIO_AUTH_TOKEN=120165c0550111ddfd58efc97dafc2fe - - #log_settings ENV LOG_BASE_PATH=$CONTAINER_APP_ROOT/log/$APP_NAME ENV BACKEND_LOG_FILE_NAME=$APP_NAME ENV APPLICATION_ACTIVITY_LOG=$APP_NAME-activity - WORKDIR ${CONTAINER_APP_ROOT} COPY requirements.txt . @@ -38,9 +33,6 @@ RUN pip install --no-cache-dir -r requirements.txt COPY . ${CONTAINER_APP_ROOT} -RUN apt update -RUN apt install -y netcat -RUN ln -s /bin/bash /usr/bin/bash - EXPOSE ${SERVICE_API_ACCESS_PORT} -CMD ["uvicorn", "webapi.main:app", "--reload", "--port=${SERVICE_API_ACCESS_PORT}", "--host=${SERVICE_API_ACCESS_HOST}"] +# Using shell to expand environemnt to enure pass the actual environment value to uvicorn +CMD uvicorn webapi.main:app --reload --port=$SERVICE_API_ACCESS_PORT --host=$SERVICE_API_ACCESS_HOST \ No newline at end of file diff --git a/apps/notification/backend/infra/rabbitmq/async_client.py b/apps/notification/backend/infra/rabbitmq/async_client.py index 4b5c929..0df0745 100644 --- a/apps/notification/backend/infra/rabbitmq/async_client.py +++ b/apps/notification/backend/infra/rabbitmq/async_client.py @@ -26,6 +26,9 @@ class AsyncMQClient: self.connection = await aio_pika.connect_robust( host=app_settings.RABBITMQ_HOST, port=int(app_settings.RABBITMQ_PORT), + login=app_settings.RABBITMQ_USERNAME, + password=app_settings.RABBITMQ_PASSWORD, + virtualhost=app_settings.RABBITMQ_VIRTUAL_HOST, loop=event_loop, ) self.channel = await self.connection.channel() diff --git a/apps/notification/common/config/app_settings.py b/apps/notification/common/config/app_settings.py index 620d05c..ec72713 100644 --- a/apps/notification/common/config/app_settings.py +++ b/apps/notification/common/config/app_settings.py @@ -8,6 +8,9 @@ class AppSettings(BaseSettings): RABBITMQ_HOST: str = "" RABBITMQ_PORT: int = 5672 + RABBITMQ_USERNAME: str = "" + RABBITMQ_PASSWORD: str = "" + RABBITMQ_VIRTUAL_HOST: str = "" SYSTEM_USER_ID: str = "" SMS_FROM: str = "" diff --git a/apps/payment/Dockerfile b/apps/payment/Dockerfile index ea1836d..f5ac56d 100644 --- a/apps/payment/Dockerfile +++ b/apps/payment/Dockerfile @@ -15,14 +15,11 @@ ENV MONGODB_NAME=freeleaps2 ENV MONGODB_PORT=27017 ENV MONGODB_URI="mongodb://freeleaps2-mongodb:27017/" - - #log_settings ENV LOG_BASE_PATH=$CONTAINER_APP_ROOT/log/$APP_NAME ENV BACKEND_LOG_FILE_NAME=$APP_NAME ENV APPLICATION_ACTIVITY_LOG=$APP_NAME-activity - WORKDIR ${CONTAINER_APP_ROOT} COPY requirements.txt . @@ -31,21 +28,6 @@ RUN pip install --no-cache-dir -r requirements.txt COPY . ${CONTAINER_APP_ROOT} -#RUN apt update -y -#RUN apt install -y netcat -#RUN ln -s /bin/bash /usr/bin/bash - -# Install tools and keyring updates -#RUN apt-get update && apt-get install -y --no-install-recommends \ -# gnupg wget && \ -# apt-get install -y debian-keyring debian-archive-keyring && \ -# rm -rf /var/lib/apt/lists/* -# -## Install additional tools and create symbolic links -#RUN apt-get update && apt-get install -y netcat && \ -# ln -s /bin/bash /usr/bin/bash && \ -# rm -rf /var/lib/apt/lists/* - EXPOSE ${SERVICE_API_ACCESS_PORT} -#CMD ["uvicorn", "webapi.main:app", "--reload", "--port=${SERVICE_API_ACCESS_PORT}", "--host=${SERVICE_API_ACCESS_HOST}"] +# Using shell to expand environemnt to enure pass the actual environment value to uvicorn CMD uvicorn webapi.main:app --reload --port=${SERVICE_API_ACCESS_PORT} --host=${SERVICE_API_ACCESS_HOST} \ No newline at end of file