Hozifa Elgharbawy commited on
Commit
bb89f60
·
2 Parent(s): f52f1cd 3240035

Merge branch 'main' into nutrition_model

Browse files
Dockerfile CHANGED
@@ -1,6 +1,9 @@
1
  # Use the official Node.js v18 image as the base image
2
  FROM node:18
3
 
 
 
 
4
  # Set the working directory inside the container
5
  WORKDIR /app
6
 
@@ -25,9 +28,11 @@ ARG JWT_SECRET
25
  ARG JWT_EXPIRES_IN
26
  ARG DB_URI
27
 
 
 
 
28
  # Expose the port on which your application will run
29
  EXPOSE $PORT
30
 
31
  # Command to run the application
32
- #CMD ["node", "dist/index.js"]
33
- CMD ["npm", "run", "start:dev"]
 
1
  # Use the official Node.js v18 image as the base image
2
  FROM node:18
3
 
4
+ # install python3 and pip
5
+ RUN apt-get update && apt-get install -y python3 python3-pip
6
+
7
  # Set the working directory inside the container
8
  WORKDIR /app
9
 
 
28
  ARG JWT_EXPIRES_IN
29
  ARG DB_URI
30
 
31
+ # install python dependencies
32
+ RUN pip3 install -r requirements.txt --break-system-packages
33
+
34
  # Expose the port on which your application will run
35
  EXPOSE $PORT
36
 
37
  # Command to run the application
38
+ CMD ["./run-script.sh"]
 
models-server/models/fitness_model.py CHANGED
@@ -252,8 +252,8 @@ class FitnessModel:
252
 
253
  @classmethod
254
  def load(cls):
255
-
256
  with open(FITNESS_MODEL_PATH, "rb") as f:
 
257
  fitness_model = pickle.load(f)
258
 
259
  return fitness_model
 
252
 
253
  @classmethod
254
  def load(cls):
 
255
  with open(FITNESS_MODEL_PATH, "rb") as f:
256
+ print(f)
257
  fitness_model = pickle.load(f)
258
 
259
  return fitness_model
run-script.sh ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ #!/bin/sh
2
+
3
+ python models-server/server.py &
4
+ npm run start:dev