I would like install nodejs, npm, redis and memcached with docker and docker-compose. But i did not install only redis (by document).
I did next: 1 install docker, docker-compose 2 create folder: ~/app 3 in catalog was create Dockerfile, docker-compose.yml, app.py,requirements.txt
requirements.txt:
redis
app.py:
from flask import Flask
from redis import Redis
app = Flask(__name__)
redis = Redis(host='redis', port=6379)
@app.route('/')
def hello():
count = redis.incr('hits')
return 'Hello World! I have been seen {} times.\n'.format(count)
if __name__ == "__main__":
app.run(host="0.0.0.0", debug=True)
Dockerfile:
FROM redis:3.2-stable
ADD . /app
WORKDIR /app
RUN pip install -r requirements.txt
CMD [ "app.py"]
docker-compose.yml
version: '2'
services:
web:
build: .
ports:
- "5000:5000"
volumes:
- .:/code
redis:
image: "redis:alpine"
run compose docker-compose up -d and have error
Couldn't connect to Docker daemon at http+docker://localunixsocket - is it running? If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable.
What is problem? How setup at least one redis ?
P.S. If you know how install with docker-compose nodejs npm and memcached I will be grateful