Browse Source

alexa demo running

dirkse 8 years ago
parent
commit
64c24e0e9f
2 changed files with 15 additions and 9 deletions
  1. 6 9
      alexa/Dockerfile
  2. 9 0
      alexa/server.py

+ 6 - 9
alexa/Dockerfile

@@ -1,17 +1,14 @@
 FROM resin/rpi-raspbian:jessie-20170531
 
-RUN apt-get update
-RUN apt-get install -y python python-dev
+RUN apt-get update && \
+    apt-get install -y gcc python python-dev libffi-dev libssl-dev libxml2-dev libxslt1-dev
 
 ADD https://bootstrap.pypa.io/get-pip.py /tmp/get-pip.py
-RUN python /tmp/get-pip.py
-RUN pip install flask flask-ask unidecode
-
-COPY server.py /app/server.py
-
-WORKDIR /app
+RUN python /tmp/get-pip.py && \
+    pip install flask flask-ask unidecode
 
 EXPOSE 80
-
 CMD python -u /app/server.py
 
+COPY server.py /app/server.py
+

+ 9 - 0
alexa/server.py

@@ -1 +1,10 @@
+from flask import Flask
 
+app = Flask(__name__)
+
+@app.route('/')
+def homepage():
+    return "Hi there, how ya doin?"
+
+if __name__ == '__main__':
+    app.run(debug=True, host='0.0.0.0', port=80)