version_number

This commit is contained in:
ahmed531998 2023-08-30 12:08:23 +02:00
parent 3d34443505
commit 98bf3c9eb3
3 changed files with 9 additions and 5 deletions

View File

@ -4,6 +4,9 @@ WORKDIR /backend_janet
COPY requirements_simple.txt .
ARG version_info
ENV FLASK_APP_VERSION_INFO=${version_info}
RUN pip install -r requirements_simple.txt
RUN rm -fr /root/.cache/*

2
Jenkinsfile vendored
View File

@ -18,7 +18,7 @@ pipeline {
stage('Building image') {
steps{
script {
dockerImage = docker.build imagename
dockerImage = docker.build(imagename, '--build-arg version_info=${GIT_COMMIT} .')
}
}
}

View File

@ -10,10 +10,11 @@ from DM import DM
import threading
app = Flask(__name__)
url = os.getenv("FRONTEND_URL_WITH_PORT")
version = os.getenv("FLASK_APP_VERSION_INFO")
#first 3 were url
cors = CORS(app, resources={r"/api/predict": {"origins": "*"},
r"/api/feedback": {"origins": "*"},
r"/api/dm": {"origins": "*"},
cors = CORS(app, resources={r"/api/predict": {"origins": url},
r"/api/feedback": {"origins": url},
r"/api/dm": {"origins": url},
r"/health": {"origins": "*"}
})
users = {}
@ -32,7 +33,7 @@ def user_interest_decay(token):
@app.route("/health", methods=['GET'])
def health():
if alive=="alive":
return "Success", 200
return "Success \n" + "version number: " + version, 200
else:
return alive, 500