Skip to content

Commit

Permalink
Fix to import opencv, but an old version
Browse files Browse the repository at this point in the history
  • Loading branch information
tomoto committed Dec 9, 2017
1 parent 40073ba commit df8d4ff
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
18 changes: 8 additions & 10 deletions Dockerfile
@@ -1,25 +1,23 @@
#Grab the latest alpine image
FROM alpine:latest
FROM heroku/heroku:16

# Install python and pip
RUN apk add --no-cache --update python py-pip bash
ADD ./webapp/requirements.txt /tmp/requirements.txt
# Install pip and opencv
RUN apt-get update && apt-get install -y python-pip python-opencv

# Install dependencies
ADD ./webapp/requirements.txt /tmp/requirements.txt
RUN pip install --no-cache-dir -q -r /tmp/requirements.txt

# Add our code
ADD ./webapp /opt/webapp/
WORKDIR /opt/webapp

# Expose is NOT supported by Heroku
# EXPOSE 5000
# EXPOSE 5000

# Run the image as a non-root user
RUN adduser -D myuser
RUN useradd -m myuser
USER myuser

# Run the app. CMD is required to run on Heroku
# $PORT is set by Heroku
CMD gunicorn --bind 0.0.0.0:$PORT wsgi

# $PORT is set by Heroku
CMD gunicorn --bind 0.0.0.0:$PORT wsgi
3 changes: 2 additions & 1 deletion webapp/app.py
@@ -1,12 +1,13 @@
import os
import cv2

from flask import Flask

app = Flask(__name__)

@app.route('/')
def hello():
return 'Hello world!'
return cv2.__version__

if __name__ == '__main__':
app.run(host='0.0.0.0')

0 comments on commit df8d4ff

Please sign in to comment.