I want to create python + mysql service for simple development environment and download some information from internet.
I don't want to create new build every time, therefore I want to use bind mount for python source code.
My catalog is: 'python_mysql'.
I created there: docker-compose.yml
version: '3.6'
services:
python:
image: python:latest
ports:
- '80:80'
volumes:
- type: bind
source: .
target: /scripts
mysql:
image: mysql/mysql-server:latest
volumes:
- type: volume
source: mysql-db1
target: /var/lib/mysql
volumes:
mysql-db1:
I have named volume also - database file : mysql-db1 - i want to used it.
$ docker volume ls
DRIVER VOLUME NAME
local mysql-db1
After:
$ docker-compose up -d
Creating network "python_mysql_default" with the default driver
Creating python_mysql_mysql_1 ... done
Creating python_mysql_python_1 ... done
have:
$ docker container ls -a
https://gyazo.com/b355c686db87ef0bfabbffad0ee19b37
$ docker volume ls
DRIVER VOLUME NAME
local mysql-db1
local python_mysql_mysql-db1
1) How to use the mysql-db1, not create new one ?
2) How to start python with bash command ? I want interact / go into python container and make something. It is possible without creating dockerfile ?
3) Whether bind mount is done well ?
4) Why in python container I don't see ports 80:80 ? Will the python container have an internet connection via 'request' module?
5) I dont understand top level 'volumes:' command. Can anyone explain to me on the basis of my example?
Why in python container I don't see ports 80:80?