azukiapp/python
Docker image to run Python by Azuki - http://azk.io
2.9K
Base docker image to run Python applications in azk
Database:
azk
Example of using this image with azk:
/**
* Documentation: http://docs.azk.io/Azkfile.js
*/
// Adds the systems that shape your system
systems({
"my-app": {
// Dependent systems
depends: [], // postgres, mysql, mongodb ...
// More images: http://images.azk.io
image: {"docker": "azukiapp/python"},
// Steps to execute before running instances
provision: [
"pip install --user --allow-all-external -r requirements.txt"
],
workdir: "/azk/#{manifest.dir}",
shell: "/bin/bash",
command: "python manage.py runserver 0.0.0.0:$HTTP_PORT",
wait: {"retry": 20, "timeout": 1000},
mounts : {
'/azk/#{manifest.dir}': path('.'),
'/azk/pythonuserbase': persistent('pythonuserbase'),
},
scalable: {"default": 2},
http: {
// my-app.dev.azk.io
domains: [ "#{system.name}.#{azk.default_domain}" ]
},
envs: {
// set instances variables
PATH : '/azk/pythonuserbase/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
PYTHON_ENV : 'development',
PYTHONUSERBASE: '/azk/pythonuserbase',
}
},
});
docker
To create the image azukiapp/python
, execute the following command on the docker-python folder:
$ docker build -t azukiapp/python 3.4/
To run the image and bind to port 8000:
$ docker run -it --rm --name my-app -p 8000:8000 -v "$PWD":/myapp -w /myapp azukiapp/python python server.py
# with azk
$ azk logs my-app
# with docker
$ docker logs <CONTAINER_ID>
Azuki Dockerfiles distributed under the Apache License.
docker pull azukiapp/python