Lasit Waterlabs corebackend production Environment - RajeshArunachalam/Demosikulix-practive GitHub Wiki

****Environment Detials ****

vm : 10.1.210.25

username : vm01

Waterlabs corebackend Location :

/Lasit-waterlabs-bankend-prod

****Create .Env file under Table_Extraction folder with below details : ****

DB_DRIVER=postgres

DB_NAME=productiondb

DB_PASSWORD=password

DB_USERNAME=proddb

DB_HOST=10.1.210.13

DB_PORT=5432

****### Docker file : ****

FROM python:3.8

ARG PYTHONUNBUFFERED

ARG PYTHONIOENCODING

ARG DB_STRING

ARG DB_DRIVER

ARG DB_NAME

ARG DB_PASSWORD

ARG DB_USERNAME

ARG DB_HOST

ARG DB_PORT

ENV PYTHONUNBUFFERED=1

ENV PYTHONIOENCODING=UTF-8

ENV DB_STRING=${DB_STRING}

ENV DB_DRIVER=${DB_DRIVER}

ENV DB_NAME=${DB_NAME}

ENV DB_PASSWORD=${DB_PASSWORD}

ENV DB_USERNAME=${DB_USERNAME}

ENV DB_HOST=${DB_HOST}

ENV DB_PORT=${DB_PORT}

copy the dependencies file to the working directory

COPY requirements.txt .

RUN mkdir SOURCE_PATH

RUN mkdir DESTINATION_PATH

RUN mkdir PROCESSED_PATH

RUN mkdir -p ocr_models/tessdata

RUN apt-get update

RUN apt-get install -y tesseract-ocr libtesseract-dev libleptonica-dev pkg-config

RUN apt-get install -y libgl1-mesa-glx

install dependencies

RUN pip install -r requirements.txt

copy the content of the local src directory to the working directory

COPY src/ .

command to run on container start

CMD [ "python", "./file_event_listener.py" ]

Commands

cd /Lasit-waterlabs-bankend-prod/Table_Extraction

set -a . .env set +a

docker stop Lasitwaterlabscorebackend

docker rm Lasitwaterlabscorebackend

docker build . -t lasit --build-arg DB_STRING=${DB_STRING} --build-arg DB_DRIVER=${DB_DRIVER} --build-arg DB_NAME=${DB_NAME} --build-arg DB_USERNAME=${DB_USERNAME} --build-arg DB_PASSWORD=${DB_PASSWORD} --build-arg DB_HOST=${DB_HOST} --build-arg DB_PORT=${DB_PORT}

docker run --net=host -v /opt/servers/Lasit_Waterlabs_backend:/DESTINATION_PATH -d --name Lasitwaterlabscorebackend lasit:latest &

### :::To Run job with Jenkins:::

step 1 : http://10.1.210.27:8085/job/Lasit-Waterlabs-Core-Backend/

step 2 : click on Build Now

step 3 : Go to Console outpu and verify the log

NOTE : Jenkins job Every 1 minute check's GitHub if changes available it's start job Automatically.