I have an issue with creating test database. I use mysql for db and docker compose.
I have no problem running docker containers with docker-compose, but when I run test it spits this error message.
Note that the name of django service is web, and mysql service is db.
$ docker-compose run --rm web sh -c "python manage.py test"
Creating sociallogin_web_run ... done
Creating test database for alias 'default'...
Got an error creating the test database: (1044, "Access denied for user 'myuser'#'%' to database 'test_mydb'")
my docker-compose.yml:
version: "3.9"
services:
db:
image: mysql:8
env_file:
- .env
command:
- --default-authentication-plugin=mysql_native_password
restart: always
# ports:
# - "3306:3306"
# volumes:
# - data:/var/lib/mysql
web:
build: .
command: >
sh -c "python manage.py wait_for_db &&
python manage.py makemigrations &&
python manage.py migrate &&
python manage.py runserver 0.0.0.0:8000"
volumes:
- .:/code
ports:
- "8000:8000"
depends_on:
- db
env_file:
- .env
# volumes:
# data:
my .env file looks like this:
MYSQL_ROOT_PASSWORD=rootpass
MYSQL_USER=exampleuser
MYSQL_PASSWORD=examplepass
MYSQL_DATABASE=exampledb
MYSQL_PORT=3306
SECRET_KEY=exmaple_random_characters
DATABASES in settings.py
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': os.environ.get('MYSQL_DATABASE'),
'USER': os.environ.get('MYSQL_USER'),
'PASSWORD': os.environ.get('MYSQL_PASSWORD'),
'PORT': os.environ.get('MYSQL_PORT'),
'HOST': 'db',
'TEST': {
'NAME': 'test_mydb',
}
}
}
I looked at this, and I even tried this. It didn't help me.
Anyone who's been stuck at similiar problem?
Thanks guys in advance.
As K.D Singh mentioned, It was indeed mysql user permission problem.
In short, use root user when initializing mysql container.
Not sure what keeps making separate user from making test though. Because mysql docker hub says
MYSQL_USER, MYSQL_PASSWORD
These variables are optional, used in conjunction to create a new user and to set that user's password. This user will be granted superuser permissions (see above) for the database specified by the MYSQL_DATABASE variable. Both variables are required for a user to be created.
, doesn't this mean if I create user and password then it has superuser permissions like creating database as well? Not sure why it has permission issue.
Anyway, below is what I changed.
Do note that there is no need to use this mechanism to create the root superuser, that user gets created by default with the password specified by the MYSQL_ROOT_PASSWORD variable.
I changed my DATABASES setting as follows:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': os.environ.get('MYSQL_DATABASE'),
'PASSWORD': os.environ.get('MYSQL_ROOT_PASSWORD'),
'PORT': os.environ.get('MYSQL_PORT'),
'HOST': os.environ.get('MYSQL_HOST'),
}
}
So basically I removed USER key and updated PASSWORD with MYSQL_ROOT_PASSWORD, not MYSQL_PASSWORD tied to MYSQL_USER that I initiated my container with.
my .env file has a change like this:
MYSQL_ROOT_PASSWORD=myrootpassword
MYSQL_DATABASE=mydatabasename
MYSQL_PORT=3306
MYSQL_HOST=db
SECRET_KEY=random_secret_key_that_has_no_dollar_sign
my docker-compose.yml:
version: "3.9"
services:
db:
image: mysql:8
env_file:
- .env
command:
- --default-authentication-plugin=mysql_native_password
restart: always
ports:
- "3308:3306"
# volumes:
# - data:/var/lib/mysql
web:
build: .
command: >
sh -c "python manage.py wait_for_db &&
python manage.py makemigrations &&
python manage.py migrate &&
python manage.py runserver 0.0.0.0:8000"
volumes:
- .:/code
ports:
- "8000:8000"
depends_on:
- db
env_file:
- .env
# volumes:
# data:
Interestingly as for ports part, notice that I set 3308:3306. Since I already have another running mysql container that is running with default port 3306, When I use ports 3306:3306, it didn't work. So I only changed outer port into 3308 and inner port 3306. Since django app communicates with inner port, .env file's port number stays put as 3306.
I think this is issue is not related django app, this is look like basic mysql error where you try to create/access database with that user which is not have permission for create/manage database, please test it again via root user of database.
You can visit on this url ERROR 1044 (42000): Access denied for user ''#'localhost' to database 'db' for.
Related
I have a project with a mysql database in a container. I use docker-compose to set my project up. And I want to run the mysql command to inspect te database.
So I did, and get:
docker-compose run --rm database mysql
Creating myproject_database_run ... done
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
However when I tried this it works:
docker exec -it myproject_database_1 mysql
ERROR 1045 (28000): Access denied for user 'root'#'localhost' (using password: NO)
Can anybody explain me this?
My docker-compose file:
version: "3.7"
services:
database:
image: mysql
command: --default-authentication-plugin=mysql_native_password
restart: always
ports:
- "127.0.0.1:3306:3306"
env_file: .env
volumes:
- type: volume
source: db_data
target: /var/lib/mysql
- type: bind
source: ./my.cnf
target: /etc/my.cnf
read_only: true
volumes:
db_data:
testing_images:
docker-compose run creates a new container. That's perfectly normal, but if your mysql client is configured to connect via a Unix socket, the new container will have a new filesystem and won't be able to see the main database container's /var/run directory.
When you use docker-compose run, you need to specify a TCP connection, using the setup described in Networking in Compose in the Docker documentation. For example,
docker-compose run --rm database \
mysql -h database
Since you publish ports: out of the container, you should be able to reach it from the host, without Docker. The trick here is that the mysql command-line client interprets localhost as a magic term to use a Unix socket and not a normal host name, so you need to specifically use the IP address 127.0.0.1 instead.
# From the same host, without anything Docker-specific
mysql -h 127.0.0.1
Try adding MYSQL_ROOT_PASSWORD in the environment.
environment:
MYSQL_ROOT_PASSWORD: root
This is from one of my working compose file
services:
## -----------------------------------------------
## MySql database
## -----------------------------------------------
db_mysql:
image: mysql:8.0
restart: always
volumes:
- db_mysql:/var/lib/mysql
- ./mysql:/docker-entrypoint-initdb.d
command: --default-authentication-plugin=mysql_native_password
environment:
MYSQL_ROOT_PASSWORD: root
networks:
- app-network
deploy:
mode: global
ports:
- "3306:3306"
## map volume
volumes:
db_mysql:
## in network, we can define any name under networks:
networks:
app-network:
driver: bridge
FYI: Official MySQL docker image - Docker Hub
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
In Django settings.py file make sure you have something like:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'django1',
'USER': 'django',
'PASSWORD': 'password',
'HOST': 'db',
'PORT': 3306,
}
}
then in your docker-compose.yml file make sure you have something along the lines of:
db:
image: mysql
environment:
MYSQL_ROOT_PASSWORD: docker
MYSQL_DATABASE: docker
MYSQL_USER: docker
MYSQL_PASSWORD: docker
then as per the docker/django tutorial you are following run the following again to rebuild everything and things should start working
docker-compose run web django-admin.py startproject composeexample .
In response to a further question, the mysql root password variable is required by docker when creating new databases.
EDIT: added run to docker-compose above; see edit comment
you don't need to worry about environment variable. When linking containers together you just use the container alias defined by the link as if it was the hostname.
for instance if your docker-compose.yml file were:
db:
image: postgres
web:
build: .
command: python manage.py runserver 0.0.0.0:8000
volumes:
- .:/code
ports:
- "8000:8000"
links:
- db:mydb
In your django settings you would have to set the database host to mydb.
First you need to modify the settings file...
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'postgres',
'USER': 'postgres',
'HOST': 'db',
'PORT': 5432,
} }
Then if you used the docker-compose command properly, the containers should be linked, and it should resolve the hostname db properly based on the links in the docker-compose.yml file.
Still, if you want to check the environment...
~/django-example: docker-compose run web env
Starting djangoexample_db_1...
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
HOSTNAME=66ff09ed8632
TERM=xterm
DJANGOEXAMPLE_DB_1_PORT=tcp://172.17.0.35:5432
DJANGOEXAMPLE_DB_1_PORT_5432_TCP=tcp://172.17.0.35:5432
DJANGOEXAMPLE_DB_1_PORT_5432_TCP_ADDR=172.17.0.35
DJANGOEXAMPLE_DB_1_PORT_5432_TCP_PORT=5432
DJANGOEXAMPLE_DB_1_PORT_5432_TCP_PROTO=tcp
DJANGOEXAMPLE_DB_1_NAME=/djangoexample_web_run_2/djangoexample_db_1
DJANGOEXAMPLE_DB_1_ENV_affinity:container==52c78c810792b0e7b9a231eab7ab7a3d50c95b76faf0abb8ec38a7d1ff0c7e5f
DJANGOEXAMPLE_DB_1_ENV_LANG=en_US.utf8
DJANGOEXAMPLE_DB_1_ENV_PG_MAJOR=9.4
DJANGOEXAMPLE_DB_1_ENV_PG_VERSION=9.4.4-1.pgdg70+1
DJANGOEXAMPLE_DB_1_ENV_PGDATA=/var/lib/postgresql/data
DB_PORT=tcp://172.17.0.35:5432
DB_PORT_5432_TCP=tcp://172.17.0.35:5432
DB_PORT_5432_TCP_ADDR=172.17.0.35
DB_PORT_5432_TCP_PORT=5432
DB_PORT_5432_TCP_PROTO=tcp
DB_NAME=/djangoexample_web_run_2/db
DB_ENV_affinity:container==52c78c810792b0e7b9a231eab7ab7a3d50c95b76faf0abb8ec38a7d1ff0c7e5f
DB_ENV_LANG=en_US.utf8
DB_ENV_PG_MAJOR=9.4
DB_ENV_PG_VERSION=9.4.4-1.pgdg70+1
DB_ENV_PGDATA=/var/lib/postgresql/data
DB_1_PORT=tcp://172.17.0.35:5432
DB_1_PORT_5432_TCP=tcp://172.17.0.35:5432
DB_1_PORT_5432_TCP_ADDR=172.17.0.35
DB_1_PORT_5432_TCP_PORT=5432
DB_1_PORT_5432_TCP_PROTO=tcp
DB_1_NAME=/djangoexample_web_run_2/db_1
DB_1_ENV_affinity:container==52c78c810792b0e7b9a231eab7ab7a3d50c95b76faf0abb8ec38a7d1ff0c7e5f
DB_1_ENV_LANG=en_US.utf8
DB_1_ENV_PG_MAJOR=9.4
DB_1_ENV_PG_VERSION=9.4.4-1.pgdg70+1
DB_1_ENV_PGDATA=/var/lib/postgresql/data
LANG=C.UTF-8
PYTHON_VERSION=2.7.10
PYTHON_PIP_VERSION=7.0.3
PYTHONUNBUFFERED=1
HOME=/root
The full error is Doctrine\DBAL\Exception\ConnectionException: An exception occurred in driver: SQLSTATE[HY000] [2002] No such file or directory in /app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php on line 113, but that's too long for the title.
I'm trying to set up a Symfony project locally, but I'm struggling to get the database connection to work. My parameters.yml looks as follows
parameters:
database_host: 127.0.0.1
database_port: 3306
database_name: database_name
database_user: username
database_password: password
I've been googling this issue a lot and most people seem to solve the issue by changing database_host from localhost to 127.0.0.1, but this doesn't work for me. The app itself runs via Docker, but I've set up the database connection once via Brew and once with a MySQL server for Mac. In both cases I can connect via the command line and with SequelPro/TablePlus, but whenever I try to access the website through the browser I get the "No such file or directory" error.
I've also tried multiple ways of setting up a Docker MySQL container, but can't get it to work. My docker-compose.yml looks like this;
nginx:
build: nginx
ports:
- "8080:80"
links:
- php
volumes:
- ../:/app
php:
build: php-fpm
volumes:
- ../:/app
working_dir: /app
extra_hosts:
- "site.dev: 172.17.0.1"
services:
db:
image: mysql:5.7
restart: always
environment:
MYSQL_DATABASE: 'database_name'
MYSQL_USER: 'username'
MYSQL_PASSWORD: 'password'
MYSQL_ROOT_PASSWORD: 'password_root'
ports:
- '3306:3306'
expose:
- '3306'
volumes:
- my-db:/var/lib/mysql
But whenever I run docker-compose up -d I get the error Unsupported config option for services: 'db'.
Another attempt was adding
mysql:
image: mysql:latest
volumes:
- mysql_data:/var/lib/mysql
environment:
- MYSQL_ROOT_PASSWORD='password'
- MYSQL_DATABASE='database_name'
- MYSQL_USER='username'
- MYSQL_PASSWORD='password'
To the docker-compose file, and while it does build the mysql image, I can't seem to connect to it with SequelPro/TablePlus. I ran docker-inspect on the container to get the IP (172.17.0.3), but can't seem to get access to it. I can exec into it, login using mysql -u root and create the required user and database, but then I'm still struggling to actually connect to it.
Running docker ps does show the sql container running btw;
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
b6de6030791d docker_nginx "nginx -g 'daemon of…" 19 minutes ago Up 14 minutes 0.0.0.0:8080->80/tcp docker_nginx_1
f26b832bb005 docker_php "docker-php-entrypoi…" 19 minutes ago Up 14 minutes 9000/tcp docker_php_1
6c2a9e657435 mysql:latest "docker-entrypoint.s…" 19 minutes ago Up 14 minutes 3306/tcp, 33060/tcp docker_mysql_1
I also thought it might be an issue with changes to the parameters.yml file not properly syncing with the container as I'm using Mac (at my old workplace we had to use docker-sync to make sync changes between our dev environment and the actual container), but when inspecting the container itself using exec I can see the changes in the parameters.yml file.
Could the issue be it trying to connect to a mysql server running outside the Docker container? I'm still very new to Docker so I wouldn't be surprised if that's the mistake. Any tips are appreciated 'cause I'm at a dead end.
Your docker-compose file looks wrong to me, try below docker-compose file.
I removed the links, network is much easier.
version: '3'
services:
nginx:
build: nginx
ports:
- "8080:80"
networks:
- backend
volumes:
- ../:/app
php:
build: php-fpm
volumes:
- ../:/app
working_dir: /app
networks:
- backend
extra_hosts:
- "site.dev: 172.17.0.1"
db:
image: mysql:5.7
restart: always
environment:
MYSQL_DATABASE: 'database_name'
MYSQL_USER: 'username'
MYSQL_PASSWORD: 'password'
MYSQL_ROOT_PASSWORD: 'password_root'
networks:
- backend
ports:
- '3306:3306'
volumes:
- ./my-db:/var/lib/mysql
networks:
backend:
driver: bridge
then use database_host: db in php file.
I would diagnose
Check docker logs in the mysql container => no errors
Login to the mysql container and login to mysql => no errors
Login to mysql from the host (mysql -u username -p since you are mapping to 3306 port of the host)
Make sure mysql.cnf doesn't block connect from outside(check
bind-address in the mysql configuration if it 127.0.0.1 the its only
allow to connect form locally, i would for now make it 0.0.0.0 or
commented that line if exists)
mysqld --verbose --help => you will see all options
mysqld --verbose --help | grep bind-address=> check the bind-address
Make sure the user i tried to login has enough privileges to
connect(SELECT user,host FROM mysql.user;) check your user can
connect from docker network => 172.* or anywhere=> %
I think your issue is with your parameters.yml:
parameters:
database_host: 127.0.0.1
When you run compose, MySQL and PHP will run in their own containers which will have their own IPs: 127.0.0.1 or localhost from the php won't be able to connect to the db container. It's like you deployed PHP on a virtual machine A and MySQL to another virtual machine B, but you try to access MySQL from machine A by using localhost where you should specify machine B IP or hostname.
With Docker Compose the internal DNS will resolve the service name to it's container, so you can use something like:
parameters:
# name of the service in compose should be resolved
database_host: db
The error SQLSTATE[HY000] [2002] No such file or directory may be caused when the client tries to read MySQL socket usually present at /var/lib/mysql/mysql.sock which is probably not present in your PHP container.
I setup a django project in docker container and every thing is working as expected, except I don't find the project database in mysql image.
Dockerfile
FROM python:3
RUN mkdir /django-website
WORKDIR /django-website
COPY . /django-website
RUN pip install -r requirements.txt
docker-compose.yml
version: '3'
services:
db:
image: mysql:5.7
restart: always
environment:
- MYSQL_ROOT_PASSWORD=root
- MYSQL_DATABASE=mywebsite
- MYSQL_USER=root
- MYSQL_PASSWORD=root
ports:
- '33060:3306'
volumes:
- /var/lib/mysql
web:
build: .
command: python manage.py runserver 0.0.0.0:8000
volumes:
- .:/django-website
ports:
- '8000:8000'
links:
- db
settings.py
DATABASES = {
'default': {
'ENGINE': "django.db.backends.mysql",
'NAME': "mywebsite",
'USER': "root",
'PASSWORD': "root",
'HOST': 'db',
'PORT': '3306',
}
}
I ran migrate and it worked:
docker-compose run web python manage.py migrate
I createdsuperuser:
docker-compose run web python manage.py createsuperuser
The development server is working docker-compose up and the site is working as expected, the issue when I navigate in mysql image I don't find my project related database which is mywebsite .
can you please tell me what is missing? if the database is not created, where has the migration been applied?
Thanks in advance.
I'm not sure what you mean by "I logged in mysql image shell but didn't find mywebsite database"
You are migrated the DB successfully, which means, the DB connections are valid and working.
In your docker-compose.yml file, the port mapping done like this, '33060:3306', which means the db's port 3306 is mapped to host machine's port 33060. So, this may be the issue (it's not an issue, kind of typo)
How to check the DB contents?
METHOD-1: check through django-shell of web container
1. run docker-compose up
2. open a new terminal in the same path and run docker ps
you'll get something like below
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
795093357f78 django_1_11_web "python manage.py ru…" 34 minutes ago Up 11 minutes 0.0.0.0:8000->8000/tcp django_1_11_web_1
4ae48f291e34 mysql:5.7 "docker-entrypoint.s…" 34 minutes ago Up 12 minutes 0.0.0.0:33060->3306/tcp django_1_11_db_1
3.Get into the web container by docker exec -it 795093357f78 bash command, where 795093357f78 is the respective container id
4. now you're inside the container. Then, run the command python manage.py dbshell. Now you will be in MYSQL shell of mywebsite (Screenshot)
5. run the command show tables;. It will display all the tables inside the mywebsite DB
METHOD-2: check through db container
1. repeat the steps 1 and 2 in above section
2. get into db container by docker exec -it 4ae48f291e34 bash
3. Now you'll be in bash terminal of MYSQL. Run the following commmand mysql -u root -p and enter the password when prompt
4. now you're in MYSQL server. run the command, show databases;. This will show all the databases in the server.
Have you tried defining the database image in the dockerfile? The following link is somewhat related to your problem:
https://medium.com/#lvthillo/customize-your-mysql-database-in-docker-723ffd59d8fb
I supposed that ports value of host container should be 3306 not 33060.
Use docker-compose.yml with value 3306 :
version: '3'
services:
db:
image: mysql:5.7
restart: always
environment:
- MYSQL_ROOT_PASSWORD=root
- MYSQL_DATABASE=mywebsite
- MYSQL_USER=root
- MYSQL_PASSWORD=root
ports:
- '3306:3306'
volumes:
- /var/lib/mysql
web:
build: .
command: python manage.py runserver 0.0.0.0:8000
volumes:
- .:/django-website
ports:
- '8000:8000'
links:
- db
Hope this works!
You should change the compose specification to version '2'. Take down the container and bring it back up with docker-compose up -d. Or if you intend to stay with version 3, you can instead use the following specification for database environment parameters
```
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: mywebsite
MYSQL_USER: root
MYSQL_PASSWORD: root
```
When you have problems with containers not coming up, docker logs <container-name> --tail 25 -f can give you a lot of information about the cause.
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
In Django settings.py file make sure you have something like:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'django1',
'USER': 'django',
'PASSWORD': 'password',
'HOST': 'db',
'PORT': 3306,
}
}
then in your docker-compose.yml file make sure you have something along the lines of:
db:
image: mysql
environment:
MYSQL_ROOT_PASSWORD: docker
MYSQL_DATABASE: docker
MYSQL_USER: docker
MYSQL_PASSWORD: docker
then as per the docker/django tutorial you are following run the following again to rebuild everything and things should start working
docker-compose run web django-admin.py startproject composeexample .
In response to a further question, the mysql root password variable is required by docker when creating new databases.
EDIT: added run to docker-compose above; see edit comment
you don't need to worry about environment variable. When linking containers together you just use the container alias defined by the link as if it was the hostname.
for instance if your docker-compose.yml file were:
db:
image: postgres
web:
build: .
command: python manage.py runserver 0.0.0.0:8000
volumes:
- .:/code
ports:
- "8000:8000"
links:
- db:mydb
In your django settings you would have to set the database host to mydb.
First you need to modify the settings file...
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'postgres',
'USER': 'postgres',
'HOST': 'db',
'PORT': 5432,
} }
Then if you used the docker-compose command properly, the containers should be linked, and it should resolve the hostname db properly based on the links in the docker-compose.yml file.
Still, if you want to check the environment...
~/django-example: docker-compose run web env
Starting djangoexample_db_1...
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
HOSTNAME=66ff09ed8632
TERM=xterm
DJANGOEXAMPLE_DB_1_PORT=tcp://172.17.0.35:5432
DJANGOEXAMPLE_DB_1_PORT_5432_TCP=tcp://172.17.0.35:5432
DJANGOEXAMPLE_DB_1_PORT_5432_TCP_ADDR=172.17.0.35
DJANGOEXAMPLE_DB_1_PORT_5432_TCP_PORT=5432
DJANGOEXAMPLE_DB_1_PORT_5432_TCP_PROTO=tcp
DJANGOEXAMPLE_DB_1_NAME=/djangoexample_web_run_2/djangoexample_db_1
DJANGOEXAMPLE_DB_1_ENV_affinity:container==52c78c810792b0e7b9a231eab7ab7a3d50c95b76faf0abb8ec38a7d1ff0c7e5f
DJANGOEXAMPLE_DB_1_ENV_LANG=en_US.utf8
DJANGOEXAMPLE_DB_1_ENV_PG_MAJOR=9.4
DJANGOEXAMPLE_DB_1_ENV_PG_VERSION=9.4.4-1.pgdg70+1
DJANGOEXAMPLE_DB_1_ENV_PGDATA=/var/lib/postgresql/data
DB_PORT=tcp://172.17.0.35:5432
DB_PORT_5432_TCP=tcp://172.17.0.35:5432
DB_PORT_5432_TCP_ADDR=172.17.0.35
DB_PORT_5432_TCP_PORT=5432
DB_PORT_5432_TCP_PROTO=tcp
DB_NAME=/djangoexample_web_run_2/db
DB_ENV_affinity:container==52c78c810792b0e7b9a231eab7ab7a3d50c95b76faf0abb8ec38a7d1ff0c7e5f
DB_ENV_LANG=en_US.utf8
DB_ENV_PG_MAJOR=9.4
DB_ENV_PG_VERSION=9.4.4-1.pgdg70+1
DB_ENV_PGDATA=/var/lib/postgresql/data
DB_1_PORT=tcp://172.17.0.35:5432
DB_1_PORT_5432_TCP=tcp://172.17.0.35:5432
DB_1_PORT_5432_TCP_ADDR=172.17.0.35
DB_1_PORT_5432_TCP_PORT=5432
DB_1_PORT_5432_TCP_PROTO=tcp
DB_1_NAME=/djangoexample_web_run_2/db_1
DB_1_ENV_affinity:container==52c78c810792b0e7b9a231eab7ab7a3d50c95b76faf0abb8ec38a7d1ff0c7e5f
DB_1_ENV_LANG=en_US.utf8
DB_1_ENV_PG_MAJOR=9.4
DB_1_ENV_PG_VERSION=9.4.4-1.pgdg70+1
DB_1_ENV_PGDATA=/var/lib/postgresql/data
LANG=C.UTF-8
PYTHON_VERSION=2.7.10
PYTHON_PIP_VERSION=7.0.3
PYTHONUNBUFFERED=1
HOME=/root