Last active
August 29, 2015 14:17
-
-
Save gullitmiranda/8058d5521d382a9e3dd0 to your computer and use it in GitHub Desktop.
Azkfile to PHP with FPM and Mysql.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Documentation: http://docs.azk.io/Azkfile.js | |
*/ | |
// Adds the systems that shape your system | |
systems({ | |
phpSample: { | |
// Dependent systems | |
depends: ["mysql"], | |
// More images: http://images.azk.io | |
image: {"docker": "azukiapp/php-fpm"}, | |
workdir: "/azk/#{manifest.dir}", | |
shell: "/bin/bash", | |
wait: {"retry": 20, "timeout": 1000}, | |
mounts: { | |
'/azk/#{manifest.dir}': path("."), | |
}, | |
scalable: {"default": 2}, | |
http: { | |
domains: [ "#{system.name}.#{azk.default_domain}" ] | |
}, | |
ports: { | |
// exports global variables | |
http: "80/tcp", | |
}, | |
envs: { | |
// set instances variables | |
APP_DIR: "/azk/#{manifest.dir}", | |
}, | |
docker_extra: { | |
// extra docker options | |
start: { | |
Privileged: "true", | |
}, | |
}, | |
}, | |
mysql: { | |
// Dependent systems | |
depends: [], | |
// More images: http://images.azk.io | |
image: {"docker": "azukiapp/mysql:5.6"}, | |
shell: "/bin/bash", | |
wait: {"retry": 25, "timeout": 1000}, | |
mounts: { | |
'/var/lib/mysql': persistent("mysql_#{manifest.dir}"), | |
}, | |
ports: { | |
// exports global variables | |
data: "3306/tcp", | |
}, | |
envs: { | |
// set instances variables | |
MYSQL_ROOT_PASSWORD: "mysecretpassword", | |
MYSQL_USER: "azk", | |
MYSQL_PASS: "azk", | |
MYSQL_DATABASE: "mysql_development", | |
}, | |
export_envs: { | |
// check this gist to configure your database | |
// https://gist.github.com/gullitmiranda/62082f2e47c364ef9617 | |
DATABASE_URL: "mysql2://#{envs.MYSQL_USER}:#{envs.MYSQL_PASS}@#{net.host}:#{net.port.data}/${envs.MYSQL_DATABASE}", | |
}, | |
}, | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment