I've been following with the docker-compose tutorial here (linking django and postgres container). Although I was able to go through with the tutorial I'm however not able to proceed with repeating the same using a mysql container. The following are my dockerfile and docker-compose.yml `
db:
image: mysql
web:
build: .
command: python manage.py runserver 0.0.0.0:8000
volumes:
- .:/code
ports:
- "8000:8000"
links:
- db:db
` dockerfile
FROM python:2.7
RUN mkdir /code
WORKDIR /code
RUN pip install mysql-python
RUN pip install django
They both build fine when I do docker-compose up
but it seems the db environment variables are not passed to the django container since when I run os.environ.keys()
in one of my django views I can't see any of the expected DB_* environment variables.
So does mysql require a different setup or am I missing something.
Thank you.
[EDIT] Docker compose version
docker-compose version: 1.3.0
CPython version: 2.7.9
OpenSSL version: OpenSSL 1.0.1e 11 Feb 2013
Docker version
Docker version 1.6.2, build 7c8fca2