How can I install Numpy and tensorflow inside a Docker image?
I'm trying to create a image of this simple Flask app:
import numpy as np
import tensorflow as tf
from flask import Flask, jsonify
print(tf.__version__)
with open('../assets/model/v1/model_architecture_V1.json', 'r') as f:
model_json = f.read()
model = tf.keras.models.model_from_json(model_json)
model.load_weights("../assets/model/v1/model_weight_V1.h5")
app = Flask(__name__)
@app.route("/api/v1", methods=["GET"])
def getPrediction():
prediction = model.predict()
return jsonify({"Fe": 3123 })
if __name__ == '__main__':
app.run(host='0.0.0.0', port=4000, debug=True)
This is my DockerFile
FROM alpine:3.10
RUN apk add --no-cache python3-dev \
&& pip3 install --upgrade pip
WORKDIR /app
COPY . /app
RUN pip3 --no-cache-dir install -r requirements.txt
CMD ["python3","src/app.py"]
And this is my requirements.txt:
Flask==1.1.2
numpy==1.18.1
tensorflow==2.0.0
When I build the image, Docker throws an error that says tensorflow and numpy cant be found.
Error: