The problem is that after I try to run docker-compose, after everything is loaded (python dependencies), docker-compose will just freeze
Recreating sensorarray_web_1...
Attaching to sensorarray_web_1
My directory structure is as follows:
.
├── docker-compose.yml
├── Dockerfile
├── requirements.txt
└── sensoryarray.py
Dockerfile:
FROM python:2.7
WORKDIR /code
ADD requirements.txt /code/
RUN pip install -r requirements.txt
ADD . /code
CMD python sensorarray.py
Docker-compose.yml
web:
build: .
command: python sensorarray.py
ports:
- "5000:5000"
volumes:
- .:/code
sensoryarray.py:
from flask import Flask
app = Flask(__name__)
@app.route('/')
def hello():
return 'Hello World!'
if __name__ == "__main__":
app.run(host="0.0.0.0", debug=True)
I also ran the hello world dock example and it seems to be working fine.
source
share