├── bin └── laradock │ ├── traefik │ ├── acme.json │ ├── Dockerfile │ └── traefik.toml │ ├── certbot │ ├── letsencrypt │ │ ├── .gitkeep │ │ └── .well-known │ │ │ └── .gitkeep │ ├── run-certbot.sh │ └── Dockerfile │ ├── logstash │ ├── pipeline │ │ └── .gitkeep │ ├── config │ │ └── logstash.yml │ └── Dockerfile │ ├── jupyterhub │ ├── userlist │ ├── start.sh │ ├── start-notebook.sh │ ├── Dockerfile │ ├── start-singleuser.sh │ └── Dockerfile.user │ ├── aws-eb-cli │ ├── .gitignore │ └── Dockerfile │ ├── php-fpm │ ├── phalcon.ini │ ├── aerospike.ini │ ├── xhprof.ini │ ├── opcache.ini │ ├── laravel.ini │ ├── xdebug.ini │ ├── mysql.ini │ ├── xdebug │ └── xlaravel.pool.conf │ ├── nginx │ ├── sites │ │ ├── .gitignore │ │ ├── default.conf │ │ ├── app.conf.example │ │ ├── laravel.conf.example │ │ └── symfony.conf.example │ ├── ssl │ │ └── .gitignore │ ├── logrotate │ │ └── nginx │ ├── startup.sh │ ├── Dockerfile │ └── nginx.conf │ ├── php-worker │ ├── supervisord.d │ │ ├── .gitignore │ │ ├── laravel-worker.conf.example │ │ └── laravel-scheduler.conf.example │ └── supervisord.conf │ ├── laravel-horizon │ ├── supervisord.d │ │ ├── .gitignore │ │ └── laravel-horizon.conf.example │ ├── supervisord.conf │ └── Dockerfile │ ├── mariadb │ ├── docker-entrypoint-initdb.d │ │ ├── .gitignore │ │ └── createdb.sql.example │ ├── my.cnf │ └── Dockerfile │ ├── mysql │ ├── docker-entrypoint-initdb.d │ │ ├── .gitignore │ │ └── createdb.sql.example │ ├── my.cnf │ └── Dockerfile │ ├── percona │ ├── docker-entrypoint-initdb.d │ │ ├── .gitignore │ │ └── createdb.sql.example │ ├── Dockerfile │ └── my.cnf │ ├── caddy │ ├── caddy │ │ ├── authlist.conf │ │ └── Caddyfile │ └── Dockerfile │ ├── couchdb │ └── Dockerfile │ ├── apache2 │ ├── vhost.conf │ ├── sites │ │ ├── .gitignore │ │ ├── default.apache.conf │ │ └── sample.conf.example │ └── Dockerfile │ ├── grafana │ └── Dockerfile │ ├── graylog │ ├── Dockerfile │ └── config │ │ └── log4j2.xml │ ├── jenkins │ ├── tests │ │ ├── plugins │ │ │ ├── plugins.txt │ │ │ └── Dockerfile │ │ ├── upgrade-plugins │ │ │ └── Dockerfile │ │ ├── install-plugins │ │ │ ├── Dockerfile │ │ │ └── update │ │ │ │ └── Dockerfile │ │ ├── functions.bats │ │ ├── runtime.bats │ │ ├── test_helpers.bash │ │ └── install-plugins.bats │ ├── .gitmodules │ ├── init.groovy │ ├── docker-compose.yml │ ├── .github │ │ └── ISSUE_TEMPLATE.md │ ├── Jenkinsfile │ ├── update-official-library.sh │ ├── jenkins.sh │ ├── plugins.sh │ ├── Dockerfile │ ├── publish.sh │ └── jenkins-support │ ├── workspace │ ├── composer.json │ ├── crontab │ │ └── laradock │ ├── aerospike.ini │ ├── auth.json │ ├── xdebug.ini │ ├── insecure_id_rsa.pub │ ├── mc │ │ └── config.json │ ├── insecure_id_rsa.ppk │ └── insecure_id_rsa │ ├── kibana │ └── Dockerfile │ ├── mssql │ ├── setup.sql │ ├── entrypoint.sh │ ├── create_table.sh │ └── Dockerfile │ ├── thumbor │ └── Dockerfile │ ├── docker-registry │ └── Dockerfile │ ├── ide-webide │ └── Dockerfile │ ├── gitlab │ └── Dockerfile │ ├── portainer │ └── Dockerfile │ ├── sonarqube │ └── Dockerfile │ ├── manticore │ ├── Dockerfile │ └── config │ │ └── sphinx.conf │ ├── mongo-webui │ └── Dockerfile │ ├── aerospike │ └── Dockerfile │ ├── elasticsearch │ └── Dockerfile │ ├── redis-webui │ └── Dockerfile │ ├── redis-cluster │ └── Dockerfile │ ├── docker-web-ui │ └── Dockerfile │ ├── haproxy │ └── Dockerfile │ ├── maildev │ └── Dockerfile │ ├── postgres │ ├── Dockerfile │ └── docker-entrypoint-initdb.d │ │ ├── .gitignore │ │ ├── createdb.sh.example │ │ ├── init_gitlab_db.sh │ │ ├── init_sonarqube_db.sh │ │ ├── init_confluence_db.sh │ │ └── init_jupyterhub_db.sh │ ├── selenium │ └── Dockerfile │ ├── ide-codiad │ ├── Dockerfile │ └── config.php │ ├── minio │ └── Dockerfile │ ├── mailhog │ └── Dockerfile │ ├── memcached │ └── Dockerfile │ ├── neo4j │ └── Dockerfile │ ├── docker-compose.sync.yml │ ├── postgres-postgis │ └── Dockerfile │ ├── mosquitto │ └── Dockerfile │ ├── beanstalkd │ └── Dockerfile │ ├── rabbitmq │ └── Dockerfile │ ├── ide-theia │ └── Dockerfile │ ├── zookeeper │ └── Dockerfile │ ├── .editorconfig │ ├── .gitignore │ ├── mongo │ └── Dockerfile │ ├── phpmyadmin │ └── Dockerfile │ ├── laravel-echo-server │ ├── package.json │ ├── laravel-echo-server.json │ └── Dockerfile │ ├── ipython │ ├── ipcontroller-engine.json │ ├── ipcontroller-client.json │ ├── Dockerfile.controller │ └── Dockerfile.engine │ ├── redis │ └── Dockerfile │ ├── varnish │ ├── start.sh │ └── Dockerfile │ ├── ide-icecoder │ └── Dockerfile │ ├── rethinkdb │ └── Dockerfile │ ├── docker-sync.yml │ ├── beanstalkd-console │ └── Dockerfile │ ├── hhvm │ ├── server.ini │ └── Dockerfile │ ├── LICENSE │ ├── adminer │ └── Dockerfile │ ├── solr │ └── Dockerfile │ ├── .gitlab-ci.yml │ ├── travis-build.sh │ └── sync.sh ├── app ├── Models │ ├── Service.php │ ├── DockerCompose.php │ └── OfflineModel.php ├── DockerCommands │ ├── PsCommand.php │ ├── DownCommand.php │ ├── ExecCommand.php │ ├── PushCommand.php │ ├── BuildCommand.php │ ├── RestartCommand.php │ ├── UpCommand.php │ ├── WorkspaceCommand.php │ └── DefaultCommand.php ├── Tasks │ ├── SetupPHPWorker.php │ ├── SetupNginx.php │ ├── CheckDockerComposeYamlExists.php │ ├── ParseDotEnvFile.php │ ├── SetupApache2.php │ ├── ParseDockerComposeYaml.php │ ├── SetupPostgres.php │ ├── SetupMySQL.php │ └── SetupMariaDB.php ├── Providers │ └── AppServiceProvider.php ├── Commands │ ├── ListServicesCommand.php │ ├── UninstallCommand.php │ ├── RemoveCommand.php │ ├── StatusCommand.php │ └── AddCommand.php ├── Service │ ├── BaseCommand.php │ └── DockerComposeCommand.php └── Transformers │ └── EnvironmentConfigTransformer.php ├── assets └── images │ └── laradock-cli-logo.png ├── .gitignore ├── .gitattributes ├── tests ├── TestCase.php ├── Feature │ └── InspiringCommandTest.php └── CreatesApplication.php ├── box.json ├── .editorconfig ├── TODO.md ├── config ├── laradock.php ├── app.php ├── logo.php ├── logging.php └── commands.php ├── phpunit.xml.dist ├── LICENSE.md ├── bootstrap ├── helpers.php └── app.php ├── composer.json ├── laradock └── README.md /bin/laradock/traefik/acme.json: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /bin/laradock/certbot/letsencrypt/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /bin/laradock/logstash/pipeline/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /bin/laradock/jupyterhub/userlist: -------------------------------------------------------------------------------- 1 | laradock 2 | -------------------------------------------------------------------------------- /bin/laradock/aws-eb-cli/.gitignore: -------------------------------------------------------------------------------- 1 | ./ssh_keys 2 | -------------------------------------------------------------------------------- /bin/laradock/certbot/letsencrypt/.well-known/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /bin/laradock/php-fpm/phalcon.ini: -------------------------------------------------------------------------------- 1 | extension=phalcon.so -------------------------------------------------------------------------------- /bin/laradock/nginx/sites/.gitignore: -------------------------------------------------------------------------------- 1 | *.conf 2 | !default.conf -------------------------------------------------------------------------------- /bin/laradock/php-worker/supervisord.d/.gitignore: -------------------------------------------------------------------------------- 1 | *.conf 2 | -------------------------------------------------------------------------------- /bin/laradock/laravel-horizon/supervisord.d/.gitignore: -------------------------------------------------------------------------------- 1 | *.conf 2 | -------------------------------------------------------------------------------- /bin/laradock/mariadb/docker-entrypoint-initdb.d/.gitignore: -------------------------------------------------------------------------------- 1 | *.sql 2 | -------------------------------------------------------------------------------- /bin/laradock/mysql/docker-entrypoint-initdb.d/.gitignore: -------------------------------------------------------------------------------- 1 | *.sql 2 | -------------------------------------------------------------------------------- /bin/laradock/nginx/ssl/.gitignore: -------------------------------------------------------------------------------- 1 | *.crt 2 | *.csr 3 | *.key 4 | *.pem -------------------------------------------------------------------------------- /bin/laradock/percona/docker-entrypoint-initdb.d/.gitignore: -------------------------------------------------------------------------------- 1 | *.sql 2 | -------------------------------------------------------------------------------- /bin/laradock/caddy/caddy/authlist.conf: -------------------------------------------------------------------------------- 1 | basicauth / laradock laradock 2 | -------------------------------------------------------------------------------- /bin/laradock/couchdb/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM couchdb 2 | 3 | EXPOSE 5984 4 | -------------------------------------------------------------------------------- /bin/laradock/apache2/vhost.conf: -------------------------------------------------------------------------------- 1 | Include /etc/apache2/sites-available/*.conf 2 | -------------------------------------------------------------------------------- /bin/laradock/grafana/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM grafana/grafana:latest 2 | 3 | EXPOSE 3000 -------------------------------------------------------------------------------- /bin/laradock/graylog/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM graylog/graylog:3.0 2 | 3 | EXPOSE 9000 4 | -------------------------------------------------------------------------------- /bin/laradock/jenkins/tests/plugins/plugins.txt: -------------------------------------------------------------------------------- 1 | maven-plugin:2.7.1 2 | ant:1.3 3 | -------------------------------------------------------------------------------- /bin/laradock/workspace/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "require": { 3 | 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /bin/laradock/apache2/sites/.gitignore: -------------------------------------------------------------------------------- 1 | *.conf 2 | !default.conf 3 | !default.apache.conf 4 | -------------------------------------------------------------------------------- /bin/laradock/kibana/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM docker.elastic.co/kibana/kibana:6.6.0 2 | 3 | EXPOSE 5601 4 | -------------------------------------------------------------------------------- /bin/laradock/mssql/setup.sql: -------------------------------------------------------------------------------- 1 | CREATE DATABASE $(MSSQL_DATABASE); 2 | GO 3 | USE $(MSSQL_DATABASE); 4 | GO -------------------------------------------------------------------------------- /bin/laradock/thumbor/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM apsl/thumbor 2 | 3 | CMD ["thumbor"] 4 | 5 | EXPOSE 8000 6 | -------------------------------------------------------------------------------- /bin/laradock/docker-registry/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM registry:2 2 | 3 | LABEL maintainer="ahkui " 4 | -------------------------------------------------------------------------------- /bin/laradock/ide-webide/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM webide/webide 2 | 3 | LABEL maintainer="ahkui " 4 | -------------------------------------------------------------------------------- /bin/laradock/gitlab/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM gitlab/gitlab-ce:latest 2 | 3 | LABEL maintainer="ahkui " 4 | -------------------------------------------------------------------------------- /bin/laradock/portainer/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM portainer/portainer 2 | 3 | LABEL maintainer="luciano@lucianojr.com.br" 4 | -------------------------------------------------------------------------------- /bin/laradock/sonarqube/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM sonarqube:latest 2 | 3 | LABEL maintainer="xiagw " 4 | -------------------------------------------------------------------------------- /bin/laradock/manticore/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM manticoresearch/manticore 2 | 3 | EXPOSE 9306 4 | EXPOSE 9308 5 | EXPOSE 9312 6 | -------------------------------------------------------------------------------- /bin/laradock/mongo-webui/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM mongoclient/mongoclient 2 | 3 | LABEL maintainer="ahkui " 4 | -------------------------------------------------------------------------------- /bin/laradock/workspace/crontab/laradock: -------------------------------------------------------------------------------- 1 | * * * * * laradock /usr/bin/php /var/www/artisan schedule:run >> /dev/null 2>&1 2 | -------------------------------------------------------------------------------- /app/Models/Service.php: -------------------------------------------------------------------------------- 1 | " 4 | -------------------------------------------------------------------------------- /bin/laradock/elasticsearch/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM docker.elastic.co/elasticsearch/elasticsearch:7.1.1 2 | 3 | EXPOSE 9200 9300 4 | -------------------------------------------------------------------------------- /bin/laradock/redis-webui/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM erikdubbelboer/phpredisadmin 2 | 3 | LABEL maintainer="ahkui " 4 | -------------------------------------------------------------------------------- /bin/laradock/redis-cluster/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM grokzen/redis-cluster:latest 2 | 3 | LABEL maintainer="hareku " 4 | -------------------------------------------------------------------------------- /bin/laradock/docker-web-ui/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM konradkleine/docker-registry-frontend:v2 2 | 3 | LABEL maintainer="ahkui " 4 | -------------------------------------------------------------------------------- /bin/laradock/jenkins/tests/upgrade-plugins/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM bats-jenkins 2 | 3 | RUN /usr/local/bin/install-plugins.sh maven-plugin:2.13 ant:1.2 4 | -------------------------------------------------------------------------------- /bin/laradock/haproxy/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM dockercloud/haproxy:latest 2 | 3 | LABEL maintainer="ZeroC0D3 Team" 4 | 5 | EXPOSE 80 6 | -------------------------------------------------------------------------------- /bin/laradock/maildev/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM djfarrelly/maildev 2 | 3 | LABEL maintainer="Maxime Hélias " 4 | 5 | EXPOSE 80 25 6 | -------------------------------------------------------------------------------- /bin/laradock/postgres/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM postgres:alpine 2 | 3 | LABEL maintainer="Ben M " 4 | 5 | CMD ["postgres"] 6 | 7 | EXPOSE 5432 8 | -------------------------------------------------------------------------------- /bin/laradock/selenium/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM selenium/standalone-chrome 2 | 3 | LABEL maintainer="Edmund Luong " 4 | 5 | EXPOSE 4444 6 | -------------------------------------------------------------------------------- /bin/laradock/ide-codiad/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM linuxserver/codiad 2 | 3 | LABEL maintainer="ahkui " 4 | 5 | COPY config.php /defaults/config.php 6 | -------------------------------------------------------------------------------- /bin/laradock/jenkins/tests/install-plugins/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM bats-jenkins 2 | 3 | RUN /usr/local/bin/install-plugins.sh maven-plugin:2.7.1 ant:1.3 mesos:0.13.0 4 | -------------------------------------------------------------------------------- /bin/laradock/minio/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM minio/minio 2 | 3 | LABEL maintainer="Thor Erik Lie " 4 | 5 | ENTRYPOINT ["minio", "server", "/export"] 6 | -------------------------------------------------------------------------------- /bin/laradock/mailhog/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM mailhog/mailhog 2 | 3 | LABEL maintainer="Mahmoud Zalt " 4 | 5 | CMD ["Mailhog"] 6 | 7 | EXPOSE 1025 8025 8 | -------------------------------------------------------------------------------- /bin/laradock/memcached/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM memcached:latest 2 | 3 | LABEL maintainer="Mahmoud Zalt " 4 | 5 | CMD ["memcached"] 6 | 7 | EXPOSE 11211 8 | -------------------------------------------------------------------------------- /bin/laradock/postgres/docker-entrypoint-initdb.d/.gitignore: -------------------------------------------------------------------------------- 1 | *.sh 2 | !init_gitlab_db.sh 3 | !init_jupyterhub_db.sh 4 | !init_sonarqube_db.sh 5 | !init_confluence_db.sh -------------------------------------------------------------------------------- /bin/laradock/caddy/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM abiosoft/caddy:no-stats 2 | 3 | CMD ["--conf", "/etc/caddy/Caddyfile", "--log", "stdout", "--agree=true"] 4 | 5 | EXPOSE 80 443 2015 6 | -------------------------------------------------------------------------------- /bin/laradock/jenkins/tests/install-plugins/update/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM bats-jenkins-install-plugins 2 | 3 | RUN /usr/local/bin/install-plugins.sh maven-plugin:2.13 ant:1.3 4 | -------------------------------------------------------------------------------- /bin/laradock/neo4j/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM tpires/neo4j 2 | 3 | LABEL maintainer="Mahmoud Zalt " 4 | 5 | VOLUME /var/lib/neo4j/data 6 | 7 | EXPOSE 7474 1337 8 | -------------------------------------------------------------------------------- /bin/laradock/docker-compose.sync.yml: -------------------------------------------------------------------------------- 1 | version: '3' 2 | 3 | services: 4 | 5 | volumes: 6 | applications-sync: 7 | external: 8 | name: "applications-docker-sync" 9 | -------------------------------------------------------------------------------- /bin/laradock/php-fpm/aerospike.ini: -------------------------------------------------------------------------------- 1 | extension=aerospike.so 2 | aerospike.udf.lua_system_path=/usr/local/aerospike/lua 3 | aerospike.udf.lua_user_path=/usr/local/aerospike/usr-lua -------------------------------------------------------------------------------- /bin/laradock/postgres-postgis/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM mdillon/postgis:latest 2 | 3 | LABEL maintainer="Mahmoud Zalt " 4 | 5 | CMD ["postgres"] 6 | 7 | EXPOSE 5432 8 | -------------------------------------------------------------------------------- /bin/laradock/workspace/aerospike.ini: -------------------------------------------------------------------------------- 1 | extension=aerospike.so 2 | aerospike.udf.lua_system_path=/usr/local/aerospike/lua 3 | aerospike.udf.lua_user_path=/usr/local/aerospike/usr-lua -------------------------------------------------------------------------------- /bin/laradock/mosquitto/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM eclipse-mosquitto:latest 2 | 3 | LABEL maintainer="Luis Coutinho " 4 | 5 | COPY mosquitto.conf /mosquitto/config/ 6 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /vendor 2 | /.idea 3 | /.vscode 4 | /.vagrant 5 | 6 | 7 | docker-compose.yml 8 | env 9 | .env.laradock 10 | .env 11 | 12 | public 13 | 14 | !bin/laradock/**/** 15 | -------------------------------------------------------------------------------- /bin/laradock/jenkins/tests/plugins/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM bats-jenkins 2 | 3 | COPY plugins.txt /usr/share/jenkins/ref/ 4 | RUN /usr/local/bin/plugins.sh /usr/share/jenkins/ref/plugins.txt 5 | -------------------------------------------------------------------------------- /bin/laradock/logstash/config/logstash.yml: -------------------------------------------------------------------------------- 1 | http.host: "0.0.0.0" 2 | 3 | xpack.monitoring.enabled: false 4 | config.reload.automatic: true 5 | path.config: "/usr/share/logstash/pipeline" 6 | -------------------------------------------------------------------------------- /bin/laradock/workspace/auth.json: -------------------------------------------------------------------------------- 1 | { 2 | "http-basic": { 3 | "repo.magento.com": { 4 | "username": "", 5 | "password": "" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /bin/laradock/mssql/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #start SQL Server, start the script to create the DB and import the data, start the app 2 | /opt/mssql/bin/sqlservr & /usr/src/app/create_table.sh & tail -f /dev/null 3 | -------------------------------------------------------------------------------- /bin/laradock/traefik/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM traefik:1.7.5-alpine 2 | 3 | LABEL maintainer="Luis Coutinho " 4 | 5 | COPY traefik.toml acme.json / 6 | 7 | RUN chmod 600 /acme.json 8 | -------------------------------------------------------------------------------- /bin/laradock/beanstalkd/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine 2 | LABEL maintainer="Mahmoud Zalt " 3 | 4 | RUN apk add --no-cache beanstalkd 5 | 6 | EXPOSE 11300 7 | ENTRYPOINT ["/usr/bin/beanstalkd"] 8 | -------------------------------------------------------------------------------- /bin/laradock/jupyterhub/start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (c) Jupyter Development Team. 3 | # Distributed under the terms of the Modified BSD License. 4 | 5 | set -e 6 | 7 | exec sh -c "env PATH=$PATH $*" 8 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | .travis.yml export-ignore 3 | .styleci.yml export-ignore 4 | .scrutinizer.yml export-ignore 5 | BACKERS.md export-ignore 6 | CONTRIBUTING.md export-ignore 7 | CHANGELOG.md export-ignore 8 | -------------------------------------------------------------------------------- /bin/laradock/rabbitmq/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM rabbitmq:alpine 2 | 3 | LABEL maintainer="Mahmoud Zalt " 4 | 5 | RUN rabbitmq-plugins enable --offline rabbitmq_management 6 | 7 | EXPOSE 4369 5671 5672 15671 15672 25672 8 | -------------------------------------------------------------------------------- /tests/TestCase.php: -------------------------------------------------------------------------------- 1 | " 4 | 5 | USER root 6 | 7 | RUN echo 'fs.inotify.max_user_watches=524288' >> /etc/sysctl.conf 8 | 9 | USER theia 10 | -------------------------------------------------------------------------------- /bin/laradock/zookeeper/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM zookeeper:latest 2 | 3 | LABEL maintainer="Hyduan " 4 | 5 | VOLUME /data 6 | VOLUME /datalog 7 | 8 | EXPOSE 2181 9 | 10 | CMD ["zkServer.sh", "start-foreground"] 11 | -------------------------------------------------------------------------------- /bin/laradock/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | end_of_line = lf 5 | insert_final_newline = true 6 | 7 | [*] 8 | charset = utf-8 9 | 10 | [{Dockerfile,docker-compose.yml}] 11 | indent_style = space 12 | indent_size = 2 13 | -------------------------------------------------------------------------------- /bin/laradock/mssql/create_table.sh: -------------------------------------------------------------------------------- 1 | #wait for the SQL Server to come up 2 | sleep 45 3 | 4 | #run the setup script to create the DB and the schema in the DB 5 | /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P $SA_PASSWORD -d master -i setup.sql -------------------------------------------------------------------------------- /bin/laradock/mariadb/my.cnf: -------------------------------------------------------------------------------- 1 | # MariaDB database server configuration file. 2 | # 3 | # You can use this file to overwrite the default configuration 4 | # 5 | # For explanations see 6 | # http://dev.mysql.com/doc/mysql/en/server-system-variables.html 7 | 8 | -------------------------------------------------------------------------------- /box.json: -------------------------------------------------------------------------------- 1 | {"chmod":"0755","directories":["app","bin","bootstrap","config","vendor"],"files":["composer.json"],"exclude-composer-files":false,"compression":"GZ","compactors":["Herrera\\Box\\Compactor\\Php","Herrera\\Box\\Compactor\\Json"],"main":"laradock"} -------------------------------------------------------------------------------- /app/DockerCommands/PsCommand.php: -------------------------------------------------------------------------------- 1 | " 4 | 5 | RUN chown -R mysql:root /var/lib/mysql/ 6 | 7 | COPY my.cnf /etc/mysql/conf.d/my.cnf 8 | 9 | CMD ["mysqld"] 10 | 11 | EXPOSE 3306 12 | -------------------------------------------------------------------------------- /app/DockerCommands/DownCommand.php: -------------------------------------------------------------------------------- 1 | " 4 | 5 | #COPY mongo.conf /usr/local/etc/mongo/mongo.conf 6 | 7 | VOLUME /data/db /data/configdb 8 | 9 | CMD ["mongod"] 10 | 11 | EXPOSE 27017 12 | 13 | -------------------------------------------------------------------------------- /app/DockerCommands/RestartCommand.php: -------------------------------------------------------------------------------- 1 | " 4 | 5 | # Add volume for sessions to allow session persistence 6 | VOLUME /sessions 7 | 8 | # We expose phpMyAdmin on port 80 9 | EXPOSE 80 10 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | indent_style = space 6 | indent_size = 4 7 | end_of_line = lf 8 | charset = utf-8 9 | trim_trailing_whitespace = true 10 | insert_final_newline = true 11 | 12 | [*.{json,yml}] 13 | indent_style = space 14 | indent_size = 2 15 | -------------------------------------------------------------------------------- /bin/laradock/jenkins/.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "tests/test_helper/bats-support"] 2 | path = tests/test_helper/bats-support 3 | url = https://github.com/ztombol/bats-support 4 | [submodule "tests/test_helper/bats-assert"] 5 | path = tests/test_helper/bats-assert 6 | url = https://github.com/ztombol/bats-assert 7 | -------------------------------------------------------------------------------- /bin/laradock/php-worker/supervisord.conf: -------------------------------------------------------------------------------- 1 | [supervisord] 2 | nodaemon=true 3 | [supervisorctl] 4 | [inet_http_server] 5 | port = 127.0.0.1:9001 6 | [rpcinterface:supervisor] 7 | supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface 8 | 9 | [include] 10 | files = supervisord.d/*.conf -------------------------------------------------------------------------------- /bin/laradock/php-worker/supervisord.d/laravel-worker.conf.example: -------------------------------------------------------------------------------- 1 | [program:laravel-worker] 2 | process_name=%(program_name)s_%(process_num)02d 3 | command=php /var/www/artisan queue:work --sleep=3 --tries=3 --daemon 4 | autostart=true 5 | autorestart=true 6 | numprocs=8 7 | user=laradock 8 | redirect_stderr=true 9 | -------------------------------------------------------------------------------- /bin/laradock/laravel-horizon/supervisord.conf: -------------------------------------------------------------------------------- 1 | [supervisord] 2 | nodaemon=true 3 | [supervisorctl] 4 | [inet_http_server] 5 | port = 127.0.0.1:9001 6 | [rpcinterface:supervisor] 7 | supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface 8 | 9 | [include] 10 | files = supervisord.d/*.conf -------------------------------------------------------------------------------- /bin/laradock/certbot/run-certbot.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | letsencrypt certonly --webroot -w /var/www/letsencrypt -d "$CN" --agree-tos --email "$EMAIL" --non-interactive --text 4 | 5 | cp /etc/letsencrypt/archive/"$CN"/cert1.pem /var/certs/cert1.pem 6 | cp /etc/letsencrypt/archive/"$CN"/privkey1.pem /var/certs/privkey1.pem 7 | -------------------------------------------------------------------------------- /bin/laradock/certbot/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM phusion/baseimage:latest 2 | 3 | LABEL maintainer="Mahmoud Zalt " 4 | 5 | COPY run-certbot.sh /root/certbot/run-certbot.sh 6 | 7 | RUN apt-get update 8 | RUN apt-get install -y letsencrypt 9 | 10 | ENTRYPOINT bash -c "bash /root/certbot/run-certbot.sh && sleep infinity" 11 | -------------------------------------------------------------------------------- /bin/laradock/percona/my.cnf: -------------------------------------------------------------------------------- 1 | # The MySQL Client configuration file. 2 | # 3 | # For explanations see 4 | # http://dev.mysql.com/doc/mysql/en/server-system-variables.html 5 | 6 | [mysql] 7 | 8 | [mysqld] 9 | sql-mode="STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION" 10 | -------------------------------------------------------------------------------- /bin/laradock/php-worker/supervisord.d/laravel-scheduler.conf.example: -------------------------------------------------------------------------------- 1 | [program:laravel-scheduler] 2 | process_name=%(program_name)s_%(process_num)02d 3 | command=/bin/sh -c "while [ true ]; do (php /var/www/artisan schedule:run --verbose --no-interaction &); sleep 60; done" 4 | autostart=true 5 | autorestart=true 6 | numprocs=1 7 | user=laradock 8 | redirect_stderr=true 9 | -------------------------------------------------------------------------------- /bin/laradock/laravel-echo-server/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "laravel-echo-server-docker", 3 | "description": "Docker container for running laravel-echo-server", 4 | "version": "0.0.1", 5 | "license": "MIT", 6 | "dependencies": { 7 | "laravel-echo-server": "^1.5.0" 8 | }, 9 | "scripts": { 10 | "start": "laravel-echo-server start" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /bin/laradock/php-fpm/opcache.ini: -------------------------------------------------------------------------------- 1 | ; NOTE: The actual opcache.so extention is NOT SET HERE but rather (/usr/local/etc/php/conf.d/docker-php-ext-opcache.ini) 2 | 3 | opcache.enable=1 4 | opcache.memory_consumption=256 5 | opcache.use_cwd=0 6 | opcache.max_file_size=0 7 | opcache.max_accelerated_files=30000 8 | opcache.validate_timestamps=1 9 | opcache.revalidate_freq=0 10 | -------------------------------------------------------------------------------- /TODO.md: -------------------------------------------------------------------------------- 1 | ## Laradock CLI - To Do 2 | - Support Redis 3 | - Toggling other container environment variables 4 | - Docker-compose value runtime modifications 5 | 6 | - Support more services and having them talk to each other better 7 | 8 | - Create some tests 9 | - Documentation (readme) 10 | - use zsh in workspace / add eb cli / aws cli 11 | - exporting composer file with quotes around vars 12 | -------------------------------------------------------------------------------- /bin/laradock/mysql/my.cnf: -------------------------------------------------------------------------------- 1 | # The MySQL Client configuration file. 2 | # 3 | # For explanations see 4 | # http://dev.mysql.com/doc/mysql/en/server-system-variables.html 5 | 6 | [mysql] 7 | 8 | [mysqld] 9 | sql-mode="STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION" 10 | character-set-server=utf8 11 | default-authentication-plugin=mysql_native_password 12 | -------------------------------------------------------------------------------- /bin/laradock/jenkins/init.groovy: -------------------------------------------------------------------------------- 1 | import hudson.model.*; 2 | import jenkins.model.*; 3 | 4 | 5 | Thread.start { 6 | sleep 10000 7 | println "--> setting agent port for jnlp" 8 | def env = System.getenv() 9 | int port = env['JENKINS_SLAVE_AGENT_PORT'].toInteger() 10 | Jenkins.instance.setSlaveAgentPort(port) 11 | println "--> setting agent port for jnlp... done" 12 | } 13 | -------------------------------------------------------------------------------- /bin/laradock/jupyterhub/start-notebook.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (c) Jupyter Development Team. 3 | # Distributed under the terms of the Modified BSD License. 4 | 5 | set -e 6 | 7 | if [[ ! -z "${JUPYTERHUB_API_TOKEN}" ]]; then 8 | # launched by JupyterHub, use single-user entrypoint 9 | exec /usr/local/bin/start-singleuser.sh $* 10 | else 11 | . /usr/local/bin/start.sh jupyter notebook $* 12 | fi 13 | -------------------------------------------------------------------------------- /bin/laradock/nginx/logrotate/nginx: -------------------------------------------------------------------------------- 1 | /var/log/nginx/*.log { 2 | daily 3 | missingok 4 | rotate 32 5 | compress 6 | delaycompress 7 | nodateext 8 | notifempty 9 | create 644 www-data root 10 | sharedscripts 11 | postrotate 12 | [ -f /var/run/nginx.pid ] && kill -USR1 `cat /var/run/nginx.pid` 13 | endscript 14 | } 15 | -------------------------------------------------------------------------------- /bin/laradock/apache2/sites/default.apache.conf: -------------------------------------------------------------------------------- 1 | 2 | ServerName laradock.test 3 | DocumentRoot /var/www/ 4 | Options Indexes FollowSymLinks 5 | 6 | 7 | AllowOverride All 8 | 9 | Allow from all 10 | 11 | = 2.4> 12 | Require all granted 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /bin/laradock/ipython/ipcontroller-engine.json: -------------------------------------------------------------------------------- 1 | { 2 | "key": "868074dd-060311910ab3d6991611bccf", 3 | "signature_scheme": "hmac-sha256", 4 | "unpack": "json", 5 | "pack": "json", 6 | "ssh": "", 7 | "interface": "tcp://*", 8 | "location": "laradock-ipython", 9 | "iopub": 33327, 10 | "hb_ping": 33328, 11 | "hb_pong": 33329, 12 | "control": 33330, 13 | "mux": 33331, 14 | "task": 33332, 15 | "registration": 33333 16 | } -------------------------------------------------------------------------------- /bin/laradock/apache2/sites/sample.conf.example: -------------------------------------------------------------------------------- 1 | 2 | ServerName sample.test 3 | DocumentRoot /var/www/sample/public/ 4 | Options Indexes FollowSymLinks 5 | 6 | 7 | AllowOverride All 8 | 9 | Allow from all 10 | 11 | = 2.4> 12 | Require all granted 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /bin/laradock/laravel-echo-server/laravel-echo-server.json: -------------------------------------------------------------------------------- 1 | { 2 | "authHost": "localhost", 3 | "authEndpoint": "/broadcasting/auth", 4 | "clients": [], 5 | "database": "redis", 6 | "databaseConfig": { 7 | "redis": { 8 | "port": "6379", 9 | "host": "redis" 10 | } 11 | }, 12 | "devMode": true, 13 | "host": null, 14 | "port": "6001", 15 | "protocol": "http", 16 | "socketio": {}, 17 | "sslCertPath": "", 18 | "sslKeyPath": "" 19 | } -------------------------------------------------------------------------------- /bin/laradock/redis/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM redis:latest 2 | 3 | LABEL maintainer="Mahmoud Zalt " 4 | 5 | ## For security settings uncomment, make the dir, copy conf, and also start with the conf, to use it 6 | #RUN mkdir -p /usr/local/etc/redis 7 | #COPY redis.conf /usr/local/etc/redis/redis.conf 8 | 9 | VOLUME /data 10 | 11 | EXPOSE 6379 12 | 13 | #CMD ["redis-server", "/usr/local/etc/redis/redis.conf"] 14 | CMD ["redis-server"] 15 | -------------------------------------------------------------------------------- /bin/laradock/varnish/start.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -e 3 | 4 | for name in BACKEND_PORT BACKEND_HOST VARNISH_SERVER 5 | do 6 | eval value=\$$name 7 | sed -i "s|\${${name}}|${value}|g" /etc/varnish/default.vcl 8 | done 9 | 10 | exec bash -c \ 11 | "exec varnishd \ 12 | -a :$VARNISH_PORT \ 13 | -T localhost:6082 \ 14 | -F \ 15 | -f $VARNISH_CONFIG \ 16 | -s malloc,$CACHE_SIZE \ 17 | $VARNISHD_PARAMS" 18 | -------------------------------------------------------------------------------- /bin/laradock/ipython/ipcontroller-client.json: -------------------------------------------------------------------------------- 1 | { 2 | "key": "868074dd-060311910ab3d6991611bccf", 3 | "signature_scheme": "hmac-sha256", 4 | "unpack": "json", 5 | "pack": "json", 6 | "ssh": "", 7 | "task_scheme": "leastload", 8 | "interface": "tcp://*", 9 | "location": "laradock-ipython", 10 | "notification": 33338, 11 | "iopub": 33337, 12 | "control": 33336, 13 | "mux": 33335, 14 | "task": 33334, 15 | "registration": 33333 16 | } -------------------------------------------------------------------------------- /config/laradock.php: -------------------------------------------------------------------------------- 1 | 'docker-compose.yml', 6 | 7 | 'laradock_path' => base_path('bin/laradock/'), 8 | 9 | 'context' => env('LARADOCK_CLI_PATH', './env/docker'), 10 | 11 | 'runtime_folder' => env('LARADOCK_CLI_RUNTIME_PATH', './storage/docker/'), 12 | 13 | 'default_services' => [ 14 | 'workspace', 15 | 'php-fpm', 16 | 'docker-in-docker', 17 | ], 18 | ]; 19 | -------------------------------------------------------------------------------- /bin/laradock/jenkins/docker-compose.yml: -------------------------------------------------------------------------------- 1 | master: 2 | build: . 3 | environment: 4 | JAVA_OPTS: "-Djava.awt.headless=true" 5 | ports: 6 | - "50000:50000" 7 | # Expose Jenkins to parent on port 8090 8 | - "8090:8080" 9 | # Allow Docker In Docker 10 | privileged: true 11 | volumes: 12 | - ./jenkins_home:/var/jenkins_home 13 | # Allow Docker In Docker to use parent docker container 14 | - /var/run/docker.sock:/var/run/docker.sock -------------------------------------------------------------------------------- /bin/laradock/aws-eb-cli/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM python:slim 2 | 3 | LABEL maintainer="melchabcede@gmail.com" 4 | 5 | RUN pip install --upgrade --no-cache-dir awsebcli 6 | RUN apt-get -yqq update && apt-get -yqq install git-all 7 | 8 | #NOTE: make sure ssh keys are added to ssh_keys folder 9 | 10 | RUN mkdir root/tmp_ssh 11 | COPY /ssh_keys/. /root/.ssh/ 12 | RUN cd /root/.ssh && chmod 600 * && chmod 644 *.pub 13 | 14 | # Set default work directory 15 | WORKDIR /var/www 16 | 17 | 18 | -------------------------------------------------------------------------------- /bin/laradock/logstash/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM docker.elastic.co/logstash/logstash:6.4.2 2 | 3 | USER root 4 | RUN rm -f /usr/share/logstash/pipeline/logstash.conf 5 | RUN curl -L -o /usr/share/logstash/lib/mysql-connector-java-5.1.47.jar https://repo1.maven.org/maven2/mysql/mysql-connector-java/5.1.47/mysql-connector-java-5.1.47.jar 6 | ADD ./pipeline/ /usr/share/logstash/pipeline/ 7 | ADD ./config/ /usr/share/logstash/config/ 8 | 9 | RUN logstash-plugin install logstash-input-jdbc 10 | 11 | -------------------------------------------------------------------------------- /tests/Feature/InspiringCommandTest.php: -------------------------------------------------------------------------------- 1 | artisan('laradock') 17 | ->expectsOutput('Simplicity is the ultimate sophistication.') 18 | ->assertExitCode(0); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /tests/CreatesApplication.php: -------------------------------------------------------------------------------- 1 | make(Kernel::class)->bootstrap(); 19 | 20 | return $app; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /bin/laradock/mariadb/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG MARIADB_VERSION=latest 2 | FROM mariadb:${MARIADB_VERSION} 3 | 4 | LABEL maintainer="Mahmoud Zalt " 5 | 6 | ##################################### 7 | # Set Timezone 8 | ##################################### 9 | 10 | ARG TZ=UTC 11 | ENV TZ ${TZ} 12 | RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone && chown -R mysql:root /var/lib/mysql/ 13 | COPY my.cnf /etc/mysql/conf.d/my.cnf 14 | 15 | CMD ["mysqld"] 16 | 17 | EXPOSE 3306 18 | -------------------------------------------------------------------------------- /bin/laradock/mysql/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG MYSQL_VERSION=latest 2 | FROM mysql:${MYSQL_VERSION} 3 | 4 | LABEL maintainer="Mahmoud Zalt " 5 | 6 | ##################################### 7 | # Set Timezone 8 | ##################################### 9 | 10 | ARG TZ=UTC 11 | ENV TZ ${TZ} 12 | RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone && chown -R mysql:root /var/lib/mysql/ 13 | 14 | COPY my.cnf /etc/mysql/conf.d/my.cnf 15 | 16 | CMD ["mysqld"] 17 | 18 | EXPOSE 3306 19 | -------------------------------------------------------------------------------- /bin/laradock/ide-icecoder/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:alpine 2 | 3 | LABEL maintainer="ahkui " 4 | 5 | ARG PUID=1000 6 | ENV PUID ${PUID} 7 | ARG PGID=1000 8 | ENV PGID ${PGID} 9 | 10 | RUN apk add --no-cache git 11 | 12 | RUN addgroup -g $PGID -S laradock && \ 13 | adduser -u $PUID -S laradock -G laradock 14 | 15 | USER laradock 16 | 17 | RUN cd /home/laradock && git clone https://github.com/mattpass/ICEcoder.git 18 | 19 | WORKDIR /home/laradock/ICEcoder 20 | 21 | CMD ["php","-S","0.0.0.0:8080"] 22 | -------------------------------------------------------------------------------- /bin/laradock/laravel-echo-server/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:alpine 2 | 3 | # Create app directory 4 | RUN mkdir -p /usr/src/app 5 | WORKDIR /usr/src/app 6 | 7 | # Install app dependencies 8 | COPY package.json /usr/src/app/ 9 | 10 | RUN apk add --update \ 11 | python \ 12 | python-dev \ 13 | py-pip \ 14 | build-base 15 | 16 | RUN npm install 17 | 18 | # Bundle app source 19 | COPY laravel-echo-server.json /usr/src/app/laravel-echo-server.json 20 | 21 | EXPOSE 3000 22 | CMD [ "npm", "start", "--force" ] 23 | -------------------------------------------------------------------------------- /bin/laradock/php-fpm/laravel.ini: -------------------------------------------------------------------------------- 1 | date.timezone=UTC 2 | display_errors=Off 3 | log_errors=On 4 | 5 | ; Maximum amount of memory a script may consume (128MB) 6 | ; http://php.net/memory-limit 7 | memory_limit = 256M 8 | ; Maximum allowed size for uploaded files. 9 | ; http://php.net/upload-max-filesize 10 | upload_max_filesize = 20M 11 | ; Sets max size of post data allowed. 12 | ; http://php.net/post-max-size 13 | post_max_size = 20M 14 | max_execution_time=600 15 | default_socket_timeout=3600 16 | request_terminate_timeout=600 17 | -------------------------------------------------------------------------------- /bin/laradock/nginx/startup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ ! -f /etc/nginx/ssl/default.crt ]; then 4 | openssl genrsa -out "/etc/nginx/ssl/default.key" 2048 5 | openssl req -new -key "/etc/nginx/ssl/default.key" -out "/etc/nginx/ssl/default.csr" -subj "/CN=default/O=default/C=UK" 6 | openssl x509 -req -days 365 -in "/etc/nginx/ssl/default.csr" -signkey "/etc/nginx/ssl/default.key" -out "/etc/nginx/ssl/default.crt" 7 | fi 8 | 9 | # Start crond in background 10 | crond -l 2 -b 11 | 12 | # Start nginx in foreground 13 | nginx 14 | -------------------------------------------------------------------------------- /bin/laradock/mssql/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM microsoft/mssql-server-linux 2 | 3 | LABEL maintainer="Mahmoud Zalt " 4 | 5 | # Create config directory 6 | # an set it as WORKDIR 7 | RUN mkdir -p /usr/src/app 8 | WORKDIR /usr/src/app 9 | 10 | # Bundle app source 11 | COPY . /usr/src/app 12 | 13 | RUN chmod +x /usr/src/app/create_table.sh 14 | 15 | ENV MSSQL_DATABASE=$MSSQL_DATABASE 16 | ENV ACCEPT_EULA=Y 17 | ENV SA_PASSWORD=$MSSQL_PASSWORD 18 | 19 | VOLUME /var/opt/mssql 20 | 21 | EXPOSE 1433 22 | 23 | CMD /bin/bash ./entrypoint.sh 24 | -------------------------------------------------------------------------------- /bin/laradock/rethinkdb/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM rethinkdb:latest 2 | 3 | LABEL maintainer="Cristian Mello " 4 | 5 | VOLUME /data/rethinkdb_data 6 | 7 | #Necessary for the backup rethinkdb 8 | RUN apt-get -y update \ 9 | && apt-get -y upgrade \ 10 | && apt-get -y install python-pip \ 11 | && pip install rethinkdb \ 12 | && rm -rf /var/lib/apt/lists/* 13 | 14 | RUN cp /etc/rethinkdb/default.conf.sample /etc/rethinkdb/instances.d/instance1.conf 15 | 16 | CMD ["rethinkdb", "--bind", "all"] 17 | 18 | EXPOSE 8080 19 | -------------------------------------------------------------------------------- /bin/laradock/traefik/traefik.toml: -------------------------------------------------------------------------------- 1 | defaultEntryPoints = ["http", "https"] 2 | 3 | [entryPoints] 4 | [entryPoints.http] 5 | address = ":80" 6 | [entryPoints.http.redirect] 7 | entryPoint = "https" 8 | [entryPoints.https] 9 | address = ":443" 10 | [entryPoints.https.tls] 11 | 12 | [web] 13 | address = ":8080" 14 | [acme] 15 | email = "email@example.org" 16 | storage = "acme.json" 17 | entryPoint = "https" 18 | onHostRule = true 19 | [acme.httpChallenge] 20 | entryPoint = "http" 21 | 22 | [[acme.domais]] 23 | main = "localhost" 24 | -------------------------------------------------------------------------------- /app/Tasks/SetupPHPWorker.php: -------------------------------------------------------------------------------- 1 | " 4 | 5 | USER root 6 | 7 | RUN apk add --no-cache build-base zeromq-dev 8 | 9 | RUN python -m pip --quiet --no-cache-dir install \ 10 | ipyparallel 11 | 12 | RUN ipython profile create --parallel --profile=default 13 | 14 | COPY ipcontroller-client.json /root/.ipython/profile_default/security/ipcontroller-client.json 15 | COPY ipcontroller-engine.json /root/.ipython/profile_default/security/ipcontroller-engine.json 16 | 17 | CMD ["sh","-c","ipcontroller --ip=* --reuse"] 18 | -------------------------------------------------------------------------------- /bin/laradock/docker-sync.yml: -------------------------------------------------------------------------------- 1 | version: "2" 2 | 3 | options: 4 | verbose: false 5 | syncs: 6 | applications-docker-sync: # name of the intermediary sync volume 7 | compose-dev-file-path: 'docker-compose.sync.yml' # docker-compose override file 8 | 9 | src: '${APP_CODE_PATH_HOST}' # host source directory 10 | sync_userid: 1000 # giving permissions to www-data user (as defined in nginx and php-fpm Dockerfiles) 11 | sync_strategy: '${DOCKER_SYNC_STRATEGY}' # for osx use 'native_osx', for windows use 'unison' 12 | 13 | sync_excludes: ['laradock', 'ignored_folder_example'] # ignored directories 14 | -------------------------------------------------------------------------------- /bin/laradock/beanstalkd-console/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:latest 2 | 3 | LABEL maintainer="Mahmoud Zalt " 4 | 5 | RUN apt-get update && apt-get install -y curl 6 | 7 | RUN curl -sL https://github.com/ptrofimov/beanstalk_console/archive/master.tar.gz | tar xvz -C /tmp 8 | RUN mv /tmp/beanstalk_console-master /source 9 | 10 | RUN apt-get remove --purge -y curl && \ 11 | apt-get autoclean && \ 12 | apt-get clean && \ 13 | rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* 14 | 15 | EXPOSE 2080 16 | 17 | CMD bash -c 'BEANSTALK_SERVERS=$BEANSTALKD_PORT_11300_TCP_ADDR:11300 php -S 0.0.0.0:2080 -t /source/public' 18 | -------------------------------------------------------------------------------- /bin/laradock/php-fpm/xdebug.ini: -------------------------------------------------------------------------------- 1 | ; NOTE: The actual debug.so extention is NOT SET HERE but rather (/usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini) 2 | 3 | ; xdebug.remote_host=dockerhost 4 | xdebug.remote_connect_back=1 5 | xdebug.remote_port=9000 6 | xdebug.idekey=PHPSTORM 7 | 8 | xdebug.remote_autostart=0 9 | xdebug.remote_enable=0 10 | xdebug.cli_color=0 11 | xdebug.profiler_enable=0 12 | xdebug.profiler_output_dir="~/xdebug/phpstorm/tmp/profiling" 13 | 14 | xdebug.remote_handler=dbgp 15 | xdebug.remote_mode=req 16 | 17 | xdebug.var_display_max_children=-1 18 | xdebug.var_display_max_data=-1 19 | xdebug.var_display_max_depth=-1 20 | 21 | -------------------------------------------------------------------------------- /bin/laradock/workspace/xdebug.ini: -------------------------------------------------------------------------------- 1 | ; NOTE: The actual debug.so extention is NOT SET HERE but rather (/usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini) 2 | 3 | ; xdebug.remote_host=dockerhost 4 | xdebug.remote_connect_back=1 5 | xdebug.remote_port=9000 6 | xdebug.idekey=PHPSTORM 7 | 8 | xdebug.remote_autostart=0 9 | xdebug.remote_enable=0 10 | xdebug.cli_color=0 11 | xdebug.profiler_enable=0 12 | xdebug.profiler_output_dir="~/xdebug/phpstorm/tmp/profiling" 13 | 14 | xdebug.remote_handler=dbgp 15 | xdebug.remote_mode=req 16 | 17 | xdebug.var_display_max_children=-1 18 | xdebug.var_display_max_data=-1 19 | xdebug.var_display_max_depth=-1 20 | 21 | -------------------------------------------------------------------------------- /bin/laradock/apache2/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM webdevops/apache:ubuntu-16.04 2 | 3 | LABEL maintainer="Eric Pfeiffer " 4 | 5 | ARG PHP_UPSTREAM_CONTAINER=php-fpm 6 | ARG PHP_UPSTREAM_PORT=9000 7 | ARG PHP_UPSTREAM_TIMEOUT=60 8 | ARG DOCUMENT_ROOT=/var/www/ 9 | 10 | ENV WEB_PHP_SOCKET=${PHP_UPSTREAM_CONTAINER}:${PHP_UPSTREAM_PORT} 11 | 12 | ENV WEB_DOCUMENT_ROOT=${DOCUMENT_ROOT} 13 | 14 | ENV WEB_PHP_TIMEOUT=${PHP_UPSTREAM_TIMEOUT} 15 | 16 | EXPOSE 80 443 17 | 18 | WORKDIR /var/www/ 19 | 20 | COPY vhost.conf /etc/apache2/sites-enabled/vhost.conf 21 | 22 | ENTRYPOINT ["/opt/docker/bin/entrypoint.sh"] 23 | 24 | CMD ["supervisord"] 25 | -------------------------------------------------------------------------------- /bin/laradock/ipython/Dockerfile.engine: -------------------------------------------------------------------------------- 1 | FROM python:3.5-alpine 2 | 3 | LABEL maintainer="ahkui " 4 | 5 | USER root 6 | 7 | RUN apk add --no-cache build-base zeromq-dev 8 | 9 | RUN python -m pip --quiet --no-cache-dir install \ 10 | ipyparallel \ 11 | numpy \ 12 | pandas \ 13 | pymongo \ 14 | redis \ 15 | requests \ 16 | bs4 17 | 18 | RUN ipython profile create --parallel --profile=default 19 | 20 | COPY ipcontroller-client.json /root/.ipython/profile_default/security/ipcontroller-client.json 21 | COPY ipcontroller-engine.json /root/.ipython/profile_default/security/ipcontroller-engine.json 22 | 23 | CMD ["sh","-c","ipcluster engines"] 24 | -------------------------------------------------------------------------------- /bin/laradock/hhvm/server.ini: -------------------------------------------------------------------------------- 1 | ; php options 2 | 3 | pid = /var/run/hhvm/pid 4 | 5 | ; hhvm specific 6 | hhvm.server.port = 9000 7 | hhvm.server.type = fastcgi 8 | hhvm.server.default_document = index.php 9 | hhvm.server.error_document404 = index.php 10 | hhvm.server.upload.upload_max_file_size = 25M 11 | hhvm.log.level = Error 12 | hhvm.log.header = true 13 | hhvm.log.access[default][file] = /var/log/hhvm/access.log 14 | hhvm.log.access[default][format] = "%h %l %u %t \"%r\" %>s %b" 15 | hhvm.server.source_root=/var/www/public 16 | hhvm.repo.central.path = /var/run/hhvm/hhvm.hhbc 17 | 18 | ; Uncomment to log to files instead of STDOUT 19 | ;hhvm.log.use_log_file = true 20 | ;hhvm.log.file = /var/log/hhvm/error.log 21 | -------------------------------------------------------------------------------- /app/DockerCommands/WorkspaceCommand.php: -------------------------------------------------------------------------------- 1 | app->singleton(Laradock::class, function () { 29 | return new Laradock(); 30 | }); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /bin/laradock/manticore/config/sphinx.conf: -------------------------------------------------------------------------------- 1 | index testrt { 2 | type = rt 3 | rt_mem_limit = 128M 4 | path = /var/lib/manticore/data/testrt 5 | rt_field = title 6 | rt_field = content 7 | rt_attr_uint = gid 8 | } 9 | 10 | searchd { 11 | listen = 9312 12 | listen = 9308:http 13 | listen = 9306:mysql41 14 | log = /var/lib/manticore/log/searchd.log 15 | # you can also send query_log to /dev/stdout to be shown in docker logs 16 | query_log = /var/lib/manticore/log/query.log 17 | read_timeout = 5 18 | max_children = 30 19 | pid_file = /var/run/searchd.pid 20 | seamless_rotate = 1 21 | preopen_indexes = 1 22 | unlink_old = 1 23 | binlog_path = /var/lib/manticore/data 24 | } 25 | 26 | -------------------------------------------------------------------------------- /bin/laradock/workspace/insecure_id_rsa.pub: -------------------------------------------------------------------------------- 1 | ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQD0tfQNVXxVjST53ny/5Op7ot+GeIGEGAEnr9kgYAXK6GqnJ/3UOfWKFxl4gEusLj4hpGrT/GJVx2nIG7d/IaRifJvns+Lak4Wj+17zyPRF54/mic6a0MAREJH5aTOLuSK+DhnhTUqAt4mfdHpYmBXWdTAXDCg8gP5QLdGkdxL9M+GBk4tKiDx1hRfHV9uY6ci0lspQrhnPzzeWLktTA8uWYZlus1gv3SXX6zVD2+XB6/J7ZarNcK9iHoMLddFggSdnGs6kNLJQe0DAwncdeCQizcdXV2A9O33vaY/b0A1obUxuoCit629AwyQ9C/71f3rBSrfgUSb1pOVPmhLRJDZenf/NS8FIW194/u5slvr1u6fj/iiCYctt0PNg00UAnlybWDDKD3l5e8Kbl16uTw1/5AEc6Wl3aCmtWYpwRGeue/hnUzOXr9/SjhQLfB+ZCASt83N+u0kV7ni7G5/04z11dqZwkk6x1SAzWGJnp76piwd4AP2fu8KqNAmWsyEIZmmR5JSGS5i4sGuSGog6rZWop1LwIfNjdOLFbs+rnF0oOmpgZReo8fH+PmOkq3iHaPQvXO3Cj2d52HVxtHI+n2iKjDu3CzHIP31vfqsZKHfmoo3ckFW4yfrPcXy0gQswPj0jJUIbKLb6OfuptUsQ5SvkiwWoW4irnO3lKF9KLo3t7w== insecure@laradock 2 | -------------------------------------------------------------------------------- /app/Tasks/SetupNginx.php: -------------------------------------------------------------------------------- 1 | path = $path; 23 | } 24 | 25 | public function __invoke() 26 | { 27 | if (! File::exists($this->path)) { 28 | return false; 29 | } 30 | 31 | return true; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /app/Tasks/ParseDotEnvFile.php: -------------------------------------------------------------------------------- 1 | dotEnv = Dotenv::create($path ?? \Laradock\workingDirectory(), $file); 24 | } 25 | 26 | public function __invoke() 27 | { 28 | return $this->dotEnv->safeLoad(); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /bin/laradock/hhvm/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:14.04 2 | 3 | LABEL maintainer="Mahmoud Zalt " 4 | 5 | RUN apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0x5a16e7281be7a449 6 | 7 | RUN apt-get update -y \ 8 | && apt-get install -y software-properties-common wget \ 9 | && wget -O - http://dl.hhvm.com/conf/hhvm.gpg.key | sudo apt-key add - \ 10 | && add-apt-repository "deb http://dl.hhvm.com/ubuntu $(lsb_release -sc) main" \ 11 | && apt-get update -y \ 12 | && apt-get install -y hhvm \ 13 | && apt-get clean \ 14 | && rm -rf /var/lib/apt/lists/* 15 | 16 | RUN mkdir -p /var/www 17 | 18 | COPY server.ini /etc/hhvm/server.ini 19 | 20 | RUN usermod -u 1000 www-data 21 | 22 | WORKDIR /var/www 23 | 24 | CMD ["/usr/bin/hhvm", "-m", "server", "-c", "/etc/hhvm/server.ini"] 25 | 26 | EXPOSE 9000 27 | -------------------------------------------------------------------------------- /app/Commands/ListServicesCommand.php: -------------------------------------------------------------------------------- 1 | table(['Service'], collect($laradock->services())->map(function ($service) { 32 | return [$service]; 33 | })); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /bin/laradock/varnish/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM debian:latest 2 | 3 | LABEL maintainer="ZeroC0D3 Team" 4 | 5 | # Set Environment Variables 6 | ENV DEBIAN_FRONTEND noninteractive 7 | 8 | # Install Dependencies 9 | RUN apt-get update && apt-get install -y apt-utils && apt-get upgrade -y 10 | RUN mkdir /home/site && mkdir /home/site/cache 11 | RUN apt-get install -y varnish 12 | RUN rm -rf /var/lib/apt/lists/* 13 | 14 | # Setting Configurations 15 | ENV VARNISH_CONFIG /etc/varnish/default.vcl 16 | ENV CACHE_SIZE 128m 17 | ENV VARNISHD_PARAMS -p default_ttl=3600 -p default_grace=3600 18 | ENV VARNISH_PORT 6081 19 | ENV BACKEND_HOST localhost 20 | ENV BACKEND_PORT 80 21 | 22 | COPY default.vcl /etc/varnish/default.vcl 23 | COPY start.sh /etc/varnish/start.sh 24 | 25 | RUN chmod +x /etc/varnish/start.sh 26 | 27 | CMD ["/etc/varnish/start.sh"] 28 | 29 | EXPOSE 8080 30 | -------------------------------------------------------------------------------- /phpunit.xml.dist: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | ./tests/Feature 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | ./app 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /bin/laradock/jenkins/.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | # Issues and Contributing 2 | 3 | Please note that only issues related to this Docker image will be addressed here. 4 | 5 | * If you have Docker related issues, please ask in the [Docker user mailing list](https://groups.google.com/forum/#!forum/docker-user). 6 | * If you have Jenkins related issues, please ask in the [Jenkins mailing lists](https://jenkins-ci.org/content/mailing-lists). 7 | * If you are not sure, then this is probably not the place to create an issue and you should use any of the previously mentioned mailing lists. 8 | 9 | If after going through the previous checklist you still think you should create an issue here please provide: 10 | 11 | 12 | ### Docker commands that you execute 13 | 14 | ### Actual result 15 | 16 | ### Expected outcome 17 | 18 | ### Have you tried a non-dockerized Jenkins and get the expected outcome? 19 | 20 | ### Output of `docker version` 21 | 22 | ### Other relevant information 23 | 24 | -------------------------------------------------------------------------------- /bin/laradock/jenkins/Jenkinsfile: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env groovy 2 | 3 | properties([ 4 | buildDiscarder(logRotator(numToKeepStr: '5', artifactNumToKeepStr: '5')), 5 | pipelineTriggers([cron('@daily')]), 6 | ]) 7 | 8 | node('docker') { 9 | deleteDir() 10 | 11 | stage('Checkout') { 12 | checkout scm 13 | } 14 | 15 | if (!infra.isTrusted()) { 16 | /* Outside of the trusted.ci environment, we're building and testing 17 | * the Dockerful in this repository, but not publishing to docker hub 18 | */ 19 | stage('Build') { 20 | docker.build('jenkins') 21 | } 22 | 23 | stage('Test') { 24 | sh """ 25 | git submodule update --init --recursive 26 | git clone https://github.com/sstephenson/bats.git 27 | bats/bin/bats tests 28 | """ 29 | } 30 | } else { 31 | /* In our trusted.ci environment we only want to be publishing our 32 | * containers from artifacts 33 | */ 34 | stage('Publish') { 35 | sh './publish.sh' 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /app/Tasks/SetupApache2.php: -------------------------------------------------------------------------------- 1 | ')) { 22 | return ' '."\n"; 23 | } 24 | 25 | return $data; 26 | }, file($confFile)) 27 | )); 28 | Log::info('Configured apache2 for site '.$url); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /app/Commands/UninstallCommand.php: -------------------------------------------------------------------------------- 1 | confirmContinue('This will remove all Laradock CLI files')) { 32 | return; 33 | } 34 | 35 | $this->info('Removing Laradock CLI files.'); 36 | $laradock->cleanup(); 37 | 38 | $this->success('Laradock CLI files have been removed.'); 39 | 40 | $this->warn('Due to user permissions, you may need to manually remove the storage folder at: ./storage/docker'); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /bin/laradock/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright 2018 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /bin/laradock/mysql/docker-entrypoint-initdb.d/createdb.sql.example: -------------------------------------------------------------------------------- 1 | # 2 | # Copy createdb.sql.example to createdb.sql 3 | # then uncomment then set database name and username to create you need databases 4 | # 5 | # example: .env MYSQL_USER=appuser and needed db name is myshop_db 6 | # 7 | # CREATE DATABASE IF NOT EXISTS `myshop_db` ; 8 | # GRANT ALL ON `myshop_db`.* TO 'appuser'@'%' ; 9 | # 10 | # 11 | # this sql script will auto run when the mysql container starts and the $DATA_PATH_HOST/mysql not found. 12 | # 13 | # if your $DATA_PATH_HOST/mysql exists and you do not want to delete it, you can run by manual execution: 14 | # 15 | # docker-compose exec mysql bash 16 | # mysql -u root -p < /docker-entrypoint-initdb.d/createdb.sql 17 | # 18 | 19 | #CREATE DATABASE IF NOT EXISTS `dev_db_1` COLLATE 'utf8_general_ci' ; 20 | #GRANT ALL ON `dev_db_1`.* TO 'default'@'%' ; 21 | 22 | #CREATE DATABASE IF NOT EXISTS `dev_db_2` COLLATE 'utf8_general_ci' ; 23 | #GRANT ALL ON `dev_db_2`.* TO 'default'@'%' ; 24 | 25 | #CREATE DATABASE IF NOT EXISTS `dev_db_3` COLLATE 'utf8_general_ci' ; 26 | #GRANT ALL ON `dev_db_3`.* TO 'default'@'%' ; 27 | 28 | FLUSH PRIVILEGES ; 29 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) Nuno Maduro 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /bin/laradock/adminer/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM adminer:4 2 | 3 | LABEL maintainer="Patrick Artounian " 4 | 5 | # Add volume for sessions to allow session persistence 6 | VOLUME /sessions 7 | 8 | ##################################### 9 | # SQL SERVER: 10 | ##################################### 11 | USER root 12 | ARG INSTALL_MSSQL=false 13 | ENV INSTALL_MSSQL ${INSTALL_MSSQL} 14 | RUN if [ ${INSTALL_MSSQL} = true ]; then \ 15 | set -xe \ 16 | # && apk --update add --no-cache --virtual .phpize-deps $PHPIZE_DEPS unixodbc unixodbc-dev \ 17 | # && pecl channel-update pecl.php.net \ 18 | # && pecl install pdo_sqlsrv-4.1.8preview sqlsrv-4.1.8preview \ 19 | # && echo "extension=sqlsrv.so" > /usr/local/etc/php/conf.d/20-sqlsrv.ini \ 20 | # && echo "extension=pdo_sqlsrv.so" > /usr/local/etc/php/conf.d/20-pdo_sqlsrv.ini \ 21 | && apk --update add --no-cache freetds unixodbc \ 22 | && apk --update add --no-cache --virtual .build-deps $PHPIZE_DEPS freetds-dev unixodbc-dev \ 23 | && docker-php-ext-install pdo_dblib \ 24 | && apk del .build-deps \ 25 | ;fi 26 | 27 | USER adminer 28 | 29 | # We expose Adminer on port 8080 (Adminer's default) 30 | EXPOSE 8080 31 | -------------------------------------------------------------------------------- /bin/laradock/jupyterhub/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM python 2 | LABEL maintainer="ahkui " 3 | 4 | ENV JUPYTERHUB_USER_DATA ${JUPYTERHUB_USER_DATA} 5 | ENV JUPYTERHUB_POSTGRES_DB ${JUPYTERHUB_POSTGRES_DB} 6 | ENV JUPYTERHUB_POSTGRES_USER ${JUPYTERHUB_POSTGRES_USER} 7 | ENV JUPYTERHUB_POSTGRES_HOST ${JUPYTERHUB_POSTGRES_HOST} 8 | ENV JUPYTERHUB_POSTGRES_PASSWORD ${JUPYTERHUB_POSTGRES_PASSWORD} 9 | ENV JUPYTERHUB_OAUTH_CALLBACK_URL ${JUPYTERHUB_OAUTH_CALLBACK_URL} 10 | ENV JUPYTERHUB_OAUTH_CLIENT_ID ${JUPYTERHUB_OAUTH_CLIENT_ID} 11 | ENV JUPYTERHUB_OAUTH_CLIENT_SECRET ${JUPYTERHUB_OAUTH_CLIENT_SECRET} 12 | ENV JUPYTERHUB_LOCAL_NOTEBOOK_IMAGE ${JUPYTERHUB_LOCAL_NOTEBOOK_IMAGE} 13 | ENV JUPYTERHUB_ENABLE_NVIDIA ${JUPYTERHUB_ENABLE_NVIDIA} 14 | 15 | RUN curl -sL https://deb.nodesource.com/setup_10.x | bash - 16 | 17 | RUN apt update -yqq && \ 18 | apt-get install -y nodejs 19 | 20 | RUN npm install -g configurable-http-proxy 21 | 22 | RUN pip install jupyterhub 23 | RUN pip install oauthenticator 24 | RUN pip install dockerspawner 25 | RUN pip install psycopg2 psycopg2-binary 26 | 27 | CMD ["sh", "-c", "jupyterhub upgrade-db && jupyterhub -f /jupyterhub_config.py"] 28 | -------------------------------------------------------------------------------- /bin/laradock/mariadb/docker-entrypoint-initdb.d/createdb.sql.example: -------------------------------------------------------------------------------- 1 | ### 2 | ### Copy createdb.sql.example to createdb.sql 3 | ### then uncomment then set database name and username to create you need databases 4 | # 5 | # example: .env MYSQL_USER=appuser and need db name is myshop_db 6 | # 7 | # CREATE DATABASE IF NOT EXISTS `myshop_db` ; 8 | # GRANT ALL ON `myshop_db`.* TO 'appuser'@'%' ; 9 | # 10 | ### 11 | ### this sql script is auto run when mariadb container start and $DATA_PATH_HOST/mariadb not exists. 12 | ### 13 | ### if your $DATA_PATH_HOST/mariadb is exists and you do not want to delete it, you can run by manual execution: 14 | ### 15 | ### docker-compose exec mariadb bash 16 | ### mysql -u root -p < /docker-entrypoint-initdb.d/createdb.sql 17 | ### 18 | 19 | #CREATE DATABASE IF NOT EXISTS `dev_db_1` COLLATE 'utf8_general_ci' ; 20 | #GRANT ALL ON `dev_db_1`.* TO 'default'@'%' ; 21 | 22 | #CREATE DATABASE IF NOT EXISTS `dev_db_2` COLLATE 'utf8_general_ci' ; 23 | #GRANT ALL ON `dev_db_2`.* TO 'default'@'%' ; 24 | 25 | #CREATE DATABASE IF NOT EXISTS `dev_db_3` COLLATE 'utf8_general_ci' ; 26 | #GRANT ALL ON `dev_db_3`.* TO 'default'@'%' ; 27 | 28 | FLUSH PRIVILEGES ; 29 | -------------------------------------------------------------------------------- /bin/laradock/percona/docker-entrypoint-initdb.d/createdb.sql.example: -------------------------------------------------------------------------------- 1 | ### 2 | ### Copy createdb.sql.example to createdb.sql 3 | ### then uncomment then set database name and username to create you need databases 4 | # 5 | # example: .env MYSQL_USER=appuser and need db name is myshop_db 6 | # 7 | # CREATE DATABASE IF NOT EXISTS `myshop_db` ; 8 | # GRANT ALL ON `myshop_db`.* TO 'appuser'@'%' ; 9 | # 10 | ### 11 | ### this sql script is auto run when percona container start and $DATA_PATH_HOST/percona not exists. 12 | ### 13 | ### if your $DATA_PATH_HOST/percona is exists and you do not want to delete it, you can run by manual execution: 14 | ### 15 | ### docker-compose exec percona bash 16 | ### mysql -u root -p < /docker-entrypoint-initdb.d/createdb.sql 17 | ### 18 | 19 | #CREATE DATABASE IF NOT EXISTS `dev_db_1` COLLATE 'utf8_general_ci' ; 20 | #GRANT ALL ON `dev_db_1`.* TO 'homestead'@'%' ; 21 | 22 | #CREATE DATABASE IF NOT EXISTS `dev_db_2` COLLATE 'utf8_general_ci' ; 23 | #GRANT ALL ON `dev_db_2`.* TO 'homestead'@'%' ; 24 | 25 | #CREATE DATABASE IF NOT EXISTS `dev_db_3` COLLATE 'utf8_general_ci' ; 26 | #GRANT ALL ON `dev_db_3`.* TO 'homestead'@'%' ; 27 | 28 | FLUSH PRIVILEGES ; 29 | -------------------------------------------------------------------------------- /app/Tasks/ParseDockerComposeYaml.php: -------------------------------------------------------------------------------- 1 | path = $path; 24 | } 25 | 26 | public function __invoke() 27 | { 28 | if (! \Laradock\invoke(new CheckDockerComposeYamlExists($this->path))) { 29 | return new DockerCompose([ 30 | 'path' => $this->path, 31 | ]); 32 | } 33 | 34 | $content = Yaml::parseFile($this->path); 35 | 36 | if (empty($content)) { 37 | return new DockerCompose(); 38 | } 39 | 40 | $compose = new DockerCompose($content); 41 | $compose->path = $this->path; 42 | 43 | return $compose; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /bin/laradock/nginx/sites/default.conf: -------------------------------------------------------------------------------- 1 | server { 2 | 3 | listen 80 default_server; 4 | listen [::]:80 default_server ipv6only=on; 5 | 6 | # For https 7 | # listen 443 ssl default_server; 8 | # listen [::]:443 ssl default_server ipv6only=on; 9 | # ssl_certificate /etc/nginx/ssl/default.crt; 10 | # ssl_certificate_key /etc/nginx/ssl/default.key; 11 | 12 | server_name localhost; 13 | root /var/www/public; 14 | index index.php index.html index.htm; 15 | 16 | location / { 17 | try_files $uri $uri/ /index.php$is_args$args; 18 | } 19 | 20 | location ~ \.php$ { 21 | try_files $uri /index.php =404; 22 | fastcgi_pass php-upstream; 23 | fastcgi_index index.php; 24 | fastcgi_buffers 16 16k; 25 | fastcgi_buffer_size 32k; 26 | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 27 | #fixes timeouts 28 | fastcgi_read_timeout 600; 29 | include fastcgi_params; 30 | } 31 | 32 | location ~ /\.ht { 33 | deny all; 34 | } 35 | 36 | location /.well-known/acme-challenge/ { 37 | root /var/www/letsencrypt/; 38 | log_not_found off; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /app/Commands/RemoveCommand.php: -------------------------------------------------------------------------------- 1 | argument('service'); 35 | 36 | $this->info('Removing a service requires stopping containers, starting shut down.'); 37 | 38 | $this->call('down'); 39 | 40 | $this->info('Now removing service '.$service.'.'); 41 | 42 | $laradock->removeService($service); 43 | 44 | $this->call('status'); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /bin/laradock/nginx/sites/app.conf.example: -------------------------------------------------------------------------------- 1 | server { 2 | 3 | listen 80; 4 | listen [::]:80; 5 | 6 | # For https 7 | # listen 443 ssl; 8 | # listen [::]:443 ssl ipv6only=on; 9 | # ssl_certificate /etc/nginx/ssl/default.crt; 10 | # ssl_certificate_key /etc/nginx/ssl/default.key; 11 | 12 | server_name app.test; 13 | root /var/www/app; 14 | index index.php index.html index.htm; 15 | 16 | location / { 17 | try_files $uri $uri/ /index.php$is_args$args; 18 | } 19 | 20 | location ~ \.php$ { 21 | try_files $uri /index.php =404; 22 | fastcgi_pass php-upstream; 23 | fastcgi_index index.php; 24 | fastcgi_buffers 16 16k; 25 | fastcgi_buffer_size 32k; 26 | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 27 | #fixes timeouts 28 | fastcgi_read_timeout 600; 29 | include fastcgi_params; 30 | } 31 | 32 | location ~ /\.ht { 33 | deny all; 34 | } 35 | 36 | location /.well-known/acme-challenge/ { 37 | root /var/www/letsencrypt/; 38 | log_not_found off; 39 | } 40 | 41 | error_log /var/log/nginx/app_error.log; 42 | access_log /var/log/nginx/app_access.log; 43 | } 44 | -------------------------------------------------------------------------------- /bin/laradock/nginx/sites/laravel.conf.example: -------------------------------------------------------------------------------- 1 | server { 2 | 3 | listen 80; 4 | listen [::]:80; 5 | 6 | # For https 7 | # listen 443 ssl; 8 | # listen [::]:443 ssl ipv6only=on; 9 | # ssl_certificate /etc/nginx/ssl/default.crt; 10 | # ssl_certificate_key /etc/nginx/ssl/default.key; 11 | 12 | server_name laravel.test; 13 | root /var/www/laravel/public; 14 | index index.php index.html index.htm; 15 | 16 | location / { 17 | try_files $uri $uri/ /index.php$is_args$args; 18 | } 19 | 20 | location ~ \.php$ { 21 | try_files $uri /index.php =404; 22 | fastcgi_pass php-upstream; 23 | fastcgi_index index.php; 24 | fastcgi_buffers 16 16k; 25 | fastcgi_buffer_size 32k; 26 | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 27 | #fixes timeouts 28 | fastcgi_read_timeout 600; 29 | include fastcgi_params; 30 | } 31 | 32 | location ~ /\.ht { 33 | deny all; 34 | } 35 | 36 | location /.well-known/acme-challenge/ { 37 | root /var/www/letsencrypt/; 38 | log_not_found off; 39 | } 40 | 41 | error_log /var/log/nginx/laravel_error.log; 42 | access_log /var/log/nginx/laravel_access.log; 43 | } 44 | -------------------------------------------------------------------------------- /bin/laradock/nginx/sites/symfony.conf.example: -------------------------------------------------------------------------------- 1 | server { 2 | 3 | listen 80; 4 | listen [::]:80; 5 | 6 | # For https 7 | # listen 443 ssl; 8 | # listen [::]:443 ssl ipv6only=on; 9 | # ssl_certificate /etc/nginx/ssl/default.crt; 10 | # ssl_certificate_key /etc/nginx/ssl/default.key; 11 | 12 | server_name symfony.test; 13 | root /var/www/projects/symfony/web; 14 | index index.php index.html index.htm; 15 | 16 | location / { 17 | try_files $uri @rewriteapp; 18 | } 19 | 20 | # For Symfony 3 21 | location @rewriteapp { 22 | rewrite ^(.*)$ /app.php/$1 last; 23 | } 24 | 25 | # For Symfony 4 config 26 | # location @rewriteapp { 27 | # rewrite ^(.*)$ /index.php/$1 last; 28 | # } 29 | 30 | location ~ ^/(app|app_dev|config|index)\.php(/|$) { 31 | fastcgi_pass php-upstream; 32 | fastcgi_split_path_info ^(.+\.php)(/.*)$; 33 | include fastcgi_params; 34 | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 35 | #fixes timeouts 36 | fastcgi_read_timeout 600; 37 | fastcgi_param HTTPS off; 38 | } 39 | 40 | error_log /var/log/nginx/symfony_error.log; 41 | access_log /var/log/nginx/symfony_access.log; 42 | } 43 | -------------------------------------------------------------------------------- /bootstrap/helpers.php: -------------------------------------------------------------------------------- 1 | warn('It looks like you have not setup laradock.'); 24 | if ($this->confirm( 25 | 'Would you like to run `laradock install` instead?', 26 | true 27 | )) { 28 | $this->call('install'); 29 | 30 | return; 31 | } 32 | } 33 | 34 | $this->call('status'); 35 | 36 | $env = \Laradock\invoke(new ParseDotEnvFile()); 37 | 38 | $this->title('Starting '.$env['APP_NAME'].' '.$env['APP_URL'].' with Laradock CLI '.config('app.version')); 39 | 40 | parent::handle(); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /bin/laradock/caddy/caddy/Caddyfile: -------------------------------------------------------------------------------- 1 | # Docs: https://caddyserver.com/docs/caddyfile 2 | 0.0.0.0:80 { 3 | root /var/www/public 4 | fastcgi / php-fpm:9000 php { 5 | index index.php 6 | } 7 | 8 | # To handle .html extensions with laravel change ext to 9 | # ext / .html 10 | 11 | rewrite { 12 | to {path} {path}/ /index.php?{query} 13 | } 14 | gzip 15 | browse 16 | log /var/log/caddy/access.log 17 | errors /var/log/caddy/error.log 18 | # Uncomment to enable TLS (HTTPS) 19 | # Change the first list to listen on port 443 when enabling TLS 20 | #tls self_signed 21 | 22 | # To use Lets encrpt tls with a DNS provider uncomment these 23 | # lines and change the provider as required 24 | #tls { 25 | # dns cloudflare 26 | #} 27 | } 28 | 29 | laradock1.demo:80 { 30 | root /var/www/public 31 | # Create a Webhook in git. 32 | #git { 33 | #repo https://github.com/xxx/xxx 34 | # path /home/xxx 35 | # #interval 60 36 | # hook webhook laradock 37 | # hook_type generic 38 | #} 39 | 40 | } 41 | 42 | laradock2.demo:80 { 43 | # Create a Proxy and cors. 44 | #proxy domain.com 45 | #cors 46 | } 47 | 48 | laradock3.demo:80 { 49 | import authlist.conf 50 | root /var/www/public 51 | } -------------------------------------------------------------------------------- /bin/laradock/jenkins/update-official-library.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -eu 2 | 3 | # Generate the Docker official-images file 4 | 5 | sha() { 6 | local branch=$1 7 | git rev-parse $branch 8 | } 9 | 10 | version_from_dockerfile() { 11 | local branch=$1 12 | git show $branch:Dockerfile | grep JENKINS_VERSION: | sed -e 's/.*:-\(.*\)}/\1/' 13 | } 14 | 15 | master_sha=$(sha master) 16 | alpine_sha=$(sha alpine) 17 | 18 | master_version=$(version_from_dockerfile master) 19 | alpine_version=$(version_from_dockerfile alpine) 20 | 21 | if ! [ "$master_version" == "$alpine_version" ]; then 22 | echo "Master version '$master_version' does not match alpine version '$alpine_version'" 23 | exit 1 24 | fi 25 | 26 | cat << EOF > ../official-images/library/jenkins 27 | # maintainer: Nicolas De Loof (@ndeloof) 28 | # maintainer: Michael Neale (@michaelneale) 29 | # maintainer: Carlos Sanchez (@carlossg) 30 | 31 | latest: git://github.com/jenkinsci/jenkins-ci.org-docker@$master_sha 32 | $master_version: git://github.com/jenkinsci/jenkins-ci.org-docker@$master_sha 33 | 34 | alpine: git://github.com/jenkinsci/jenkins-ci.org-docker@$alpine_sha 35 | $alpine_version-alpine: git://github.com/jenkinsci/jenkins-ci.org-docker@$alpine_sha 36 | EOF 37 | -------------------------------------------------------------------------------- /bin/laradock/jenkins/tests/functions.bats: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bats 2 | 3 | SUT_IMAGE=bats-jenkins 4 | 5 | load 'test_helper/bats-support/load' 6 | load 'test_helper/bats-assert/load' 7 | load test_helpers 8 | 9 | . $BATS_TEST_DIRNAME/../jenkins-support 10 | 11 | @test "build image" { 12 | cd $BATS_TEST_DIRNAME/.. 13 | docker_build -t $SUT_IMAGE . 14 | } 15 | 16 | @test "versionLT" { 17 | run docker run --rm $SUT_IMAGE bash -c "source /usr/local/bin/jenkins-support && versionLT 1.0 1.0" 18 | assert_failure 19 | run docker run --rm $SUT_IMAGE bash -c "source /usr/local/bin/jenkins-support && versionLT 1.0 1.1" 20 | assert_success 21 | run docker run --rm $SUT_IMAGE bash -c "source /usr/local/bin/jenkins-support && versionLT 1.1 1.0" 22 | assert_failure 23 | run docker run --rm $SUT_IMAGE bash -c "source /usr/local/bin/jenkins-support && versionLT 1.0-beta-1 1.0" 24 | assert_success 25 | run docker run --rm $SUT_IMAGE bash -c "source /usr/local/bin/jenkins-support && versionLT 1.0 1.0-beta-1" 26 | assert_failure 27 | run docker run --rm $SUT_IMAGE bash -c "source /usr/local/bin/jenkins-support && versionLT 1.0-alpha-1 1.0-beta-1" 28 | assert_success 29 | run docker run --rm $SUT_IMAGE bash -c "source /usr/local/bin/jenkins-support && versionLT 1.0-beta-1 1.0-alpha-1" 30 | assert_failure 31 | } 32 | -------------------------------------------------------------------------------- /bin/laradock/solr/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG SOLR_VERSION=5.5 2 | FROM solr:${SOLR_VERSION} 3 | 4 | ARG SOLR_DATAIMPORTHANDLER_MYSQL=false 5 | ENV SOLR_DATAIMPORTHANDLER_MYSQL ${SOLR_DATAIMPORTHANDLER_MYSQL} 6 | 7 | # download mysql connector for dataimporthandler 8 | RUN if [ ${SOLR_DATAIMPORTHANDLER_MYSQL} = true ]; then \ 9 | curl -L -o /tmp/mysql_connector.tar.gz "https://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-5.1.45.tar.gz" \ 10 | && mkdir /opt/solr/contrib/dataimporthandler/lib \ 11 | && tar -zxvf /tmp/mysql_connector.tar.gz -C /opt/solr/contrib/dataimporthandler/lib "mysql-connector-java-5.1.45/mysql-connector-java-5.1.45-bin.jar" --strip-components 1 \ 12 | && rm /tmp/mysql_connector.tar.gz \ 13 | ;fi 14 | 15 | ARG SOLR_DATAIMPORTHANDLER_MSSQL=false 16 | ENV SOLR_DATAIMPORTHANDLER_MSSQL ${SOLR_DATAIMPORTHANDLER_MSSQL} 17 | 18 | # download mssql connector for dataimporthandler 19 | RUN if [ ${SOLR_DATAIMPORTHANDLER_MSSQL} = true ]; then \ 20 | curl -L -o /tmp/mssql-jdbc-7.0.0.jre8.jar "https://github.com/Microsoft/mssql-jdbc/releases/download/v7.0.0/mssql-jdbc-7.0.0.jre8.jar" \ 21 | && mkdir -p /opt/solr/contrib/dataimporthandler/lib \ 22 | && mv /tmp/mssql-jdbc-7.0.0.jre8.jar "/opt/solr/contrib/dataimporthandler/lib/mssql-jdbc-7.0.0.jre8.jar" \ 23 | ;fi 24 | 25 | -------------------------------------------------------------------------------- /bin/laradock/jenkins/jenkins.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash -e 2 | 3 | : "${JENKINS_HOME:="/var/jenkins_home"}" 4 | touch "${COPY_REFERENCE_FILE_LOG}" || { echo "Can not write to ${COPY_REFERENCE_FILE_LOG}. Wrong volume permissions?"; exit 1; } 5 | echo "--- Copying files at $(date)" >> "$COPY_REFERENCE_FILE_LOG" 6 | find /usr/share/jenkins/ref/ -type f -exec bash -c '. /usr/local/bin/jenkins-support; for arg; do copy_reference_file "$arg"; done' _ {} + 7 | 8 | # if `docker run` first argument start with `--` the user is passing jenkins launcher arguments 9 | if [[ $# -lt 1 ]] || [[ "$1" == "--"* ]]; then 10 | 11 | # read JAVA_OPTS and JENKINS_OPTS into arrays to avoid need for eval (and associated vulnerabilities) 12 | java_opts_array=() 13 | while IFS= read -r -d '' item; do 14 | java_opts_array+=( "$item" ) 15 | done < <([[ $JAVA_OPTS ]] && xargs printf '%s\0' <<<"$JAVA_OPTS") 16 | 17 | jenkins_opts_array=( ) 18 | while IFS= read -r -d '' item; do 19 | jenkins_opts_array+=( "$item" ) 20 | done < <([[ $JENKINS_OPTS ]] && xargs printf '%s\0' <<<"$JENKINS_OPTS") 21 | 22 | exec java "${java_opts_array[@]}" -jar /usr/share/jenkins/jenkins.war "${jenkins_opts_array[@]}" "$@" 23 | fi 24 | 25 | # As argument is not jenkins, assume user want to run his own process, for example a `bash` shell to explore this image 26 | exec "$@" 27 | -------------------------------------------------------------------------------- /app/Commands/StatusCommand.php: -------------------------------------------------------------------------------- 1 | info('Looks like you don\'t have a docker-compose.yml setup. Please run ./laradock install'); 36 | 37 | return; 38 | } 39 | 40 | $this->table(['Service', 'Context'], collect($laradockCompose['services'])->map(function ($service, $key) { 41 | return [$key, $service['build']['context'] ?? $service['build'] ?? 'Image: '.$service['image']]; 42 | })); 43 | 44 | $this->call('ps'); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /bin/laradock/.gitlab-ci.yml: -------------------------------------------------------------------------------- 1 | # image: docker:latest 2 | # services: 3 | # - docker:dind 4 | image: jonaskello/docker-and-compose:1.12.1-1.8.0 5 | services: 6 | - docker:1.12.1-dind 7 | 8 | before_script: 9 | - docker info 10 | - docker-compose version 11 | - cp env-example .env 12 | - sed -i -- "s/=false/=true/g" .env 13 | - cat .env 14 | - env | sort 15 | 16 | build:5.6:php-fpm: 17 | variables: 18 | PHP_VERSION: "5.6" 19 | script: 20 | - docker-compose build php-fpm 21 | 22 | build:7.0:php-fpm: 23 | variables: 24 | PHP_VERSION: "7.0" 25 | script: 26 | - docker-compose build php-fpm 27 | 28 | build:7.1:php-fpm: 29 | variables: 30 | PHP_VERSION: "7.1" 31 | script: 32 | - docker-compose build php-fpm 33 | 34 | build:7.2:php-fpm: 35 | variables: 36 | PHP_VERSION: "7.2" 37 | script: 38 | - docker-compose build php-fpm 39 | 40 | build:5.6:workspace: 41 | variables: 42 | PHP_VERSION: "5.6" 43 | script: 44 | - docker-compose build workspace 45 | 46 | build:7.0:workspace: 47 | variables: 48 | PHP_VERSION: "7.0" 49 | script: 50 | - docker-compose build workspace 51 | 52 | build:7.1:workspace: 53 | variables: 54 | PHP_VERSION: "7.1" 55 | script: 56 | - docker-compose build workspace 57 | 58 | build:7.2:workspace: 59 | variables: 60 | PHP_VERSION: "7.2" 61 | script: 62 | - docker-compose build workspace 63 | -------------------------------------------------------------------------------- /bin/laradock/postgres/docker-entrypoint-initdb.d/createdb.sh.example: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Copy createdb.sh.example to createdb.sh 4 | # then uncomment then set database name and username to create you need databases 5 | # 6 | # example: .env POSTGRES_USER=appuser and need db name is myshop_db 7 | # 8 | # psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL 9 | # CREATE USER myuser WITH PASSWORD 'mypassword'; 10 | # CREATE DATABASE myshop_db; 11 | # GRANT ALL PRIVILEGES ON DATABASE myshop_db TO myuser; 12 | # EOSQL 13 | # 14 | # this sh script will auto run when the postgres container starts and the $DATA_PATH_HOST/postgres not found. 15 | # 16 | # 17 | # psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL 18 | # CREATE USER db1 WITH PASSWORD 'db1'; 19 | # CREATE DATABASE db1; 20 | # GRANT ALL PRIVILEGES ON DATABASE db1 TO db1; 21 | # EOSQL 22 | # 23 | # psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL 24 | # CREATE USER db2 WITH PASSWORD 'db2'; 25 | # CREATE DATABASE db2; 26 | # GRANT ALL PRIVILEGES ON DATABASE db2 TO db2; 27 | # EOSQL 28 | # 29 | # psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL 30 | # CREATE USER db3 WITH PASSWORD 'db3'; 31 | # CREATE DATABASE db3; 32 | # GRANT ALL PRIVILEGES ON DATABASE db3 TO db3; 33 | # EOSQL 34 | -------------------------------------------------------------------------------- /bin/laradock/jupyterhub/start-singleuser.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (c) Jupyter Development Team. 3 | # Distributed under the terms of the Modified BSD License. 4 | 5 | set -e 6 | 7 | # set default ip to 0.0.0.0 8 | if [[ "$NOTEBOOK_ARGS $@" != *"--ip="* ]]; then 9 | NOTEBOOK_ARGS="--ip=0.0.0.0 $NOTEBOOK_ARGS" 10 | fi 11 | 12 | # handle some deprecated environment variables 13 | # from DockerSpawner < 0.8. 14 | # These won't be passed from DockerSpawner 0.9, 15 | # so avoid specifying --arg=empty-string 16 | # if [ ! -z "$NOTEBOOK_DIR" ]; then 17 | # NOTEBOOK_ARGS="--notebook-dir='$NOTEBOOK_DIR' $NOTEBOOK_ARGS" 18 | # fi 19 | if [ ! -z "$JPY_PORT" ]; then 20 | NOTEBOOK_ARGS="--port=$JPY_PORT $NOTEBOOK_ARGS" 21 | fi 22 | if [ ! -z "$JPY_USER" ]; then 23 | NOTEBOOK_ARGS="--user=$JPY_USER $NOTEBOOK_ARGS" 24 | fi 25 | if [ ! -z "$JPY_COOKIE_NAME" ]; then 26 | NOTEBOOK_ARGS="--cookie-name=$JPY_COOKIE_NAME $NOTEBOOK_ARGS" 27 | fi 28 | if [ ! -z "$JPY_BASE_URL" ]; then 29 | NOTEBOOK_ARGS="--base-url=$JPY_BASE_URL $NOTEBOOK_ARGS" 30 | fi 31 | if [ ! -z "$JPY_HUB_PREFIX" ]; then 32 | NOTEBOOK_ARGS="--hub-prefix=$JPY_HUB_PREFIX $NOTEBOOK_ARGS" 33 | fi 34 | if [ ! -z "$JPY_HUB_API_URL" ]; then 35 | NOTEBOOK_ARGS="--hub-api-url=$JPY_HUB_API_URL $NOTEBOOK_ARGS" 36 | fi 37 | 38 | NOTEBOOK_ARGS=" --allow-root --notebook-dir='/notebooks' $NOTEBOOK_ARGS" 39 | 40 | . /usr/local/bin/start.sh jupyterhub-singleuser $NOTEBOOK_ARGS $@ 41 | -------------------------------------------------------------------------------- /bin/laradock/nginx/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM nginx:alpine 2 | 3 | LABEL maintainer="Mahmoud Zalt " 4 | 5 | COPY nginx.conf /etc/nginx/ 6 | 7 | # If you're in China, or you need to change sources, will be set CHANGE_SOURCE to true in .env. 8 | 9 | ARG CHANGE_SOURCE=false 10 | RUN if [ ${CHANGE_SOURCE} = true ]; then \ 11 | # Change application source from dl-cdn.alpinelinux.org to aliyun source 12 | sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/' /etc/apk/repositories \ 13 | ;fi 14 | 15 | RUN apk update \ 16 | && apk upgrade \ 17 | && apk --update add logrotate \ 18 | && apk add --no-cache openssl \ 19 | && apk add --no-cache bash 20 | 21 | RUN set -x ; \ 22 | addgroup -g 82 -S www-data ; \ 23 | adduser -u 82 -D -S -G www-data www-data && exit 0 ; exit 1 24 | 25 | ARG PHP_UPSTREAM_CONTAINER=php-fpm 26 | ARG PHP_UPSTREAM_PORT=9000 27 | 28 | # Create 'messages' file used from 'logrotate' 29 | RUN touch /var/log/messages 30 | 31 | # Copy 'logrotate' config file 32 | COPY logrotate/nginx /etc/logrotate.d/ 33 | 34 | # Set upstream conf and remove the default conf 35 | RUN echo "upstream php-upstream { server ${PHP_UPSTREAM_CONTAINER}:${PHP_UPSTREAM_PORT}; }" > /etc/nginx/conf.d/upstream.conf \ 36 | && rm /etc/nginx/conf.d/default.conf 37 | 38 | ADD ./startup.sh /opt/startup.sh 39 | RUN sed -i 's/\r//g' /opt/startup.sh 40 | CMD ["/bin/bash", "/opt/startup.sh"] 41 | 42 | EXPOSE 80 443 43 | -------------------------------------------------------------------------------- /bin/laradock/nginx/nginx.conf: -------------------------------------------------------------------------------- 1 | user www-data; 2 | worker_processes 4; 3 | pid /run/nginx.pid; 4 | daemon off; 5 | 6 | events { 7 | worker_connections 2048; 8 | multi_accept on; 9 | use epoll; 10 | } 11 | 12 | http { 13 | server_tokens off; 14 | sendfile on; 15 | tcp_nopush on; 16 | tcp_nodelay on; 17 | keepalive_timeout 15; 18 | types_hash_max_size 2048; 19 | client_max_body_size 20M; 20 | include /etc/nginx/mime.types; 21 | default_type application/octet-stream; 22 | access_log /dev/stdout; 23 | error_log /dev/stderr; 24 | gzip on; 25 | gzip_disable "msie6"; 26 | 27 | ssl_protocols TLSv1 TLSv1.1 TLSv1.2; 28 | ssl_ciphers 'ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS'; 29 | 30 | include /etc/nginx/conf.d/*.conf; 31 | include /etc/nginx/sites-available/*.conf; 32 | open_file_cache off; # Disabled for issue 619 33 | charset UTF-8; 34 | } 35 | -------------------------------------------------------------------------------- /app/Service/BaseCommand.php: -------------------------------------------------------------------------------- 1 | title($title); 48 | 49 | return $this; 50 | } 51 | 52 | public function br() 53 | { 54 | parent::line(''); 55 | } 56 | 57 | public function hint($hint) 58 | { 59 | parent::line(Emoji::exclamationQuestionMark().'\e[36m'.$hint); 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /app/Service/DockerComposeCommand.php: -------------------------------------------------------------------------------- 1 | signature)) { 23 | $this->signature = str_replace('docker-compose ', '', $this->command).' {cmd?* : The docker-compose arguments}'; 24 | } 25 | if (empty($this->description)) { 26 | $this->description = 'Runs `'.$this->command.'` with the `.env.laradock` loaded in.'; 27 | } 28 | parent::__construct(); 29 | } 30 | 31 | /** 32 | * Execute the console command. 33 | * 34 | * @return mixed 35 | */ 36 | public function handle() 37 | { 38 | $this->line('Loading in .env.laradock file at: '.getLaradockCLIEnvPath('.env.laradock')); 39 | $laradockAttributes = \Laradock\invoke(new ParseDotEnvFile(getLaradockCLIEnvPath(), '.env.laradock')); 40 | $command = $this->command.' '.implode(' ', $this->input->getArgument('cmd')); 41 | $process = new Process($command, \Laradock\workingDirectory(), $laradockAttributes, null, 60000); 42 | 43 | $this->info($command); 44 | $process->setTty($this->tty); 45 | $process->run(function ($response, $output) { 46 | $this->output->write($output); 47 | }); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /bootstrap/app.php: -------------------------------------------------------------------------------- 1 | singleton( 30 | Illuminate\Contracts\Console\Kernel::class, 31 | LaravelZero\Framework\Kernel::class 32 | ); 33 | 34 | $app->singleton( 35 | Illuminate\Contracts\Debug\ExceptionHandler::class, 36 | Illuminate\Foundation\Exceptions\Handler::class 37 | ); 38 | 39 | /* 40 | |-------------------------------------------------------------------------- 41 | | Return The Application 42 | |-------------------------------------------------------------------------- 43 | | 44 | | This script returns the application instance. The instance is given to 45 | | the calling script so we can separate the building of the instances 46 | | from the actual running of the application and sending responses. 47 | | 48 | */ 49 | 50 | return $app; 51 | -------------------------------------------------------------------------------- /app/Commands/AddCommand.php: -------------------------------------------------------------------------------- 1 | argument('service'); 35 | 36 | if (empty($laradock->getOurDockerCompose())) { 37 | $this->error('Looks like you don\'t have a docker-compose.yml setup. Please run ./laradock install'); 38 | 39 | return; 40 | } 41 | 42 | // if it already exists within their docker-compose.yaml file we should confirm the re-add 43 | if ( 44 | $laradock->hasService($service) && 45 | ! $this->confirmContinue('You already have a '.$service.' service. Continuing will change your existing configuration')) { 46 | return; 47 | } 48 | 49 | if (! $laradock->addService($service)) { 50 | $this->error('Invalid service: '.$service); 51 | 52 | return; 53 | } 54 | 55 | $this->call('status'); 56 | 57 | $this->success('The service '.$service.' has been added.'); 58 | $this->comment('Please run: laradock build'); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "loonpwn/laradock-cli", 3 | "description": "Laradock CLI is a tool for Laravel projects which automates the docker configuration setup for services, amongst other things.", 4 | "keywords": ["framework", "laradock", "laravel", "laravel zero", "console", "cli"], 5 | "homepage": "https://github.com/loonpwn/laradock-cli", 6 | "type": "library", 7 | "license": "MIT", 8 | "support": { 9 | "issues": "https://github.com/loonpwn/laradock-cli/issues", 10 | "source": "https://github.com/loonpwn/laradock-cli" 11 | }, 12 | "authors": [ 13 | { 14 | "name": "Harlan Wilton", 15 | "email": "harlan@harlanzw.com" 16 | } 17 | ], 18 | "require": { 19 | "php": "^7.1.3", 20 | "laravel-zero/framework": "^5.8", 21 | "spatie/emoji": "^2.1", 22 | "symfony/yaml": "^4.2", 23 | "vlucas/phpdotenv": "^3.3", 24 | "zendframework/zend-text": "^2.7" 25 | }, 26 | "require-dev": { 27 | "mockery/mockery": "^1.0", 28 | "phpunit/phpunit": "^7.3" 29 | }, 30 | "autoload": { 31 | "files": [ 32 | "./bootstrap/helpers.php" 33 | ], 34 | "psr-4": { 35 | "Laradock\\": "app/" 36 | } 37 | }, 38 | "autoload-dev": { 39 | "psr-4": { 40 | "Tests\\": "tests/" 41 | } 42 | }, 43 | "config": { 44 | "preferred-install": "dist", 45 | "sort-packages": true, 46 | "optimize-autoloader": true, 47 | "platform": { 48 | "ext-posix": "0" 49 | } 50 | }, 51 | "scripts": { 52 | "post-create-project-cmd": [ 53 | "@php application app:rename" 54 | ], 55 | "test": "phpunit", 56 | "build": "./laradock app:build" 57 | }, 58 | "minimum-stability": "dev", 59 | "prefer-stable": true, 60 | "bin": ["laradock"] 61 | } 62 | -------------------------------------------------------------------------------- /bin/laradock/ide-codiad/config.php: -------------------------------------------------------------------------------- 1 | make(Illuminate\Contracts\Console\Kernel::class); 34 | 35 | $status = $kernel->handle( 36 | $input = new Symfony\Component\Console\Input\ArgvInput, 37 | new Symfony\Component\Console\Output\ConsoleOutput 38 | ); 39 | 40 | /* 41 | |-------------------------------------------------------------------------- 42 | | Shutdown The Application 43 | |-------------------------------------------------------------------------- 44 | | 45 | | Once Artisan has finished running, we will fire off the shutdown events 46 | | so that any final work may be done by the application before we shut 47 | | down the process. This is the last thing to happen to the request. 48 | | 49 | */ 50 | 51 | $kernel->terminate($input, $status); 52 | 53 | exit($status); 54 | -------------------------------------------------------------------------------- /bin/laradock/postgres/docker-entrypoint-initdb.d/init_jupyterhub_db.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Copy createdb.sh.example to createdb.sh 4 | # then uncomment then set database name and username to create you need databases 5 | # 6 | # example: .env POSTGRES_USER=appuser and need db name is myshop_db 7 | # 8 | # psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL 9 | # CREATE USER myuser WITH PASSWORD 'mypassword'; 10 | # CREATE DATABASE myshop_db; 11 | # GRANT ALL PRIVILEGES ON DATABASE myshop_db TO myuser; 12 | # EOSQL 13 | # 14 | # this sh script will auto run when the postgres container starts and the $DATA_PATH_HOST/postgres not found. 15 | # 16 | # 17 | # psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL 18 | # CREATE USER db1 WITH PASSWORD 'db1'; 19 | # CREATE DATABASE db1; 20 | # GRANT ALL PRIVILEGES ON DATABASE db1 TO db1; 21 | # EOSQL 22 | # 23 | # psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL 24 | # CREATE USER db2 WITH PASSWORD 'db2'; 25 | # CREATE DATABASE db2; 26 | # GRANT ALL PRIVILEGES ON DATABASE db2 TO db2; 27 | # EOSQL 28 | # 29 | # psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL 30 | # CREATE USER db3 WITH PASSWORD 'db3'; 31 | # CREATE DATABASE db3; 32 | # GRANT ALL PRIVILEGES ON DATABASE db3 TO db3; 33 | # EOSQL 34 | # 35 | ### default database and user for jupyterhub ############################################## 36 | if [ "$JUPYTERHUB_POSTGRES_INIT" == 'true' ]; then 37 | psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL 38 | CREATE USER $JUPYTERHUB_POSTGRES_USER WITH PASSWORD '$JUPYTERHUB_POSTGRES_PASSWORD'; 39 | CREATE DATABASE $JUPYTERHUB_POSTGRES_DB; 40 | GRANT ALL PRIVILEGES ON DATABASE $JUPYTERHUB_POSTGRES_DB TO $JUPYTERHUB_POSTGRES_USER; 41 | ALTER ROLE $JUPYTERHUB_POSTGRES_USER CREATEROLE SUPERUSER; 42 | EOSQL 43 | echo 44 | fi 45 | -------------------------------------------------------------------------------- /bin/laradock/graylog/config/log4j2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /app/Tasks/SetupPostgres.php: -------------------------------------------------------------------------------- 1 | 4 | 5 | RUN apt-get update && apt-get install -y --no-install-recommends \ 6 | python \ 7 | python-dev \ 8 | && \ 9 | apt-get autoremove -y && \ 10 | apt-get autoclean && \ 11 | apt-get clean && \ 12 | rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* 13 | 14 | RUN apt-get update && apt-get install -y --no-install-recommends \ 15 | wget \ 16 | git \ 17 | && \ 18 | apt-get autoremove -y && \ 19 | apt-get autoclean && \ 20 | apt-get clean && \ 21 | rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* 22 | 23 | RUN curl -O https://bootstrap.pypa.io/get-pip.py && \ 24 | python3 get-pip.py && \ 25 | rm get-pip.py 26 | 27 | RUN python3 -m pip --quiet --no-cache-dir install \ 28 | Pillow \ 29 | h5py \ 30 | ipykernel \ 31 | jupyter \ 32 | notebook \ 33 | jupyterhub \ 34 | matplotlib \ 35 | numpy \ 36 | pandas \ 37 | scipy \ 38 | sklearn \ 39 | Flask \ 40 | gunicorn \ 41 | pymongo \ 42 | redis \ 43 | requests \ 44 | ipyparallel \ 45 | bs4 \ 46 | && \ 47 | python3 -m ipykernel.kernelspec 48 | 49 | RUN pip --no-cache-dir install \ 50 | https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow_gpu-1.8.0-cp35-cp35m-linux_x86_64.whl 51 | 52 | RUN ln -s -f /usr/bin/python3 /usr/bin/python 53 | 54 | COPY start.sh /usr/local/bin/ 55 | COPY start-notebook.sh /usr/local/bin/ 56 | COPY start-singleuser.sh /usr/local/bin/ 57 | RUN chmod +x /usr/local/bin/start.sh 58 | RUN chmod +x /usr/local/bin/start-notebook.sh 59 | RUN chmod +x /usr/local/bin/start-singleuser.sh 60 | 61 | RUN wget --quiet https://github.com/krallin/tini/releases/download/v0.10.0/tini && \ 62 | mv tini /usr/local/bin/tini && \ 63 | chmod +x /usr/local/bin/tini 64 | 65 | # cleanup 66 | RUN rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* 67 | 68 | ENTRYPOINT ["tini", "--"] 69 | 70 | CMD ["start-notebook.sh"] 71 | 72 | 73 | -------------------------------------------------------------------------------- /bin/laradock/travis-build.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | #### halt script on error 4 | set -xe 5 | 6 | echo '##### Print docker version' 7 | docker --version 8 | 9 | echo '##### Print environment' 10 | env | sort 11 | 12 | #### Build the Docker Images 13 | if [ -n "${PHP_VERSION}" ]; then 14 | cp env-example .env 15 | sed -i -- "s/PHP_VERSION=.*/PHP_VERSION=${PHP_VERSION}/g" .env 16 | sed -i -- 's/=false/=true/g' .env 17 | sed -i -- 's/PHPDBG=true/PHPDBG=false/g' .env 18 | if [ "${PHP_VERSION}" == "5.6" ]; then 19 | # Aerospike C Client SDK 4.0.7, Debian 9.6 is not supported 20 | # https://github.com/aerospike/aerospike-client-php5/issues/145 21 | sed -i -- 's/PHP_FPM_INSTALL_AEROSPIKE=true/PHP_FPM_INSTALL_AEROSPIKE=false/g' .env 22 | fi 23 | if [ "${PHP_VERSION}" == "7.3" ]; then 24 | # V8JS extension does not yet support PHP 7.3. 25 | sed -i -- 's/WORKSPACE_INSTALL_V8JS=true/WORKSPACE_INSTALL_V8JS=false/g' .env 26 | # This ssh2 extension does not yet support PHP 7.3. 27 | sed -i -- 's/PHP_FPM_INSTALL_SSH2=true/PHP_FPM_INSTALL_SSH2=false/g' .env 28 | # xdebug extension does not yet support PHP 7.3. 29 | sed -i -- 's/PHP_FPM_INSTALL_XDEBUG=true/PHP_FPM_INSTALL_XDEBUG=false/g' .env 30 | # memcached extension does not yet support PHP 7.3. 31 | sed -i -- 's/PHP_FPM_INSTALL_MEMCACHED=true/PHP_FPM_INSTALL_MEMCACHED=false/g' .env 32 | fi 33 | cat .env 34 | docker-compose build ${BUILD_SERVICE} 35 | docker images 36 | fi 37 | 38 | #### Generate the Laradock Documentation site using Hugo 39 | if [ -n "${HUGO_VERSION}" ]; then 40 | HUGO_PACKAGE=hugo_${HUGO_VERSION}_Linux-64bit 41 | HUGO_BIN=hugo_${HUGO_VERSION}_linux_amd64 42 | 43 | # Download hugo binary 44 | curl -L https://github.com/spf13/hugo/releases/download/v$HUGO_VERSION/$HUGO_PACKAGE.tar.gz | tar xz 45 | mkdir -p $HOME/bin 46 | mv ./${HUGO_BIN}/${HUGO_BIN} $HOME/bin/hugo 47 | 48 | # Remove existing docs 49 | if [ -d "./docs" ]; then 50 | rm -r ./docs 51 | fi 52 | 53 | # Build docs 54 | cd DOCUMENTATION 55 | hugo 56 | fi 57 | -------------------------------------------------------------------------------- /config/app.php: -------------------------------------------------------------------------------- 1 | 'Laradock', 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Application Version 21 | |-------------------------------------------------------------------------- 22 | | 23 | | This value determines the "version" your application is currently running 24 | | in. You may want to follow the "Semantic Versioning" - Given a version 25 | | number MAJOR.MINOR.PATCH when an update happens: https://semver.org. 26 | | 27 | */ 28 | 29 | 'version' => app('git.version'), 30 | 31 | /* 32 | |-------------------------------------------------------------------------- 33 | | Application Environment 34 | |-------------------------------------------------------------------------- 35 | | 36 | | This value determines the "environment" your application is currently 37 | | running in. This may determine how you prefer to configure various 38 | | services your application utilizes. Should be true in production. 39 | | 40 | */ 41 | 42 | 'production' => false, 43 | 44 | /* 45 | |-------------------------------------------------------------------------- 46 | | Autoloaded Service Providers 47 | |-------------------------------------------------------------------------- 48 | | 49 | | The service providers listed here will be automatically loaded on the 50 | | request to your application. Feel free to add your own services to 51 | | this array to grant expanded functionality to your applications. 52 | | 53 | */ 54 | 55 | 'providers' => [ 56 | \Laradock\Providers\AppServiceProvider::class, 57 | ], 58 | 59 | ]; 60 | -------------------------------------------------------------------------------- /bin/laradock/php-fpm/mysql.ini: -------------------------------------------------------------------------------- 1 | [MySQL] 2 | ; Allow accessing, from PHP's perspective, local files with LOAD DATA statements 3 | ; http://php.net/mysql.allow_local_infile 4 | mysql.allow_local_infile = On 5 | 6 | ; Allow or prevent persistent links. 7 | ; http://php.net/mysql.allow-persistent 8 | mysql.allow_persistent = On 9 | 10 | ; If mysqlnd is used: Number of cache slots for the internal result set cache 11 | ; http://php.net/mysql.cache_size 12 | mysql.cache_size = 2000 13 | 14 | ; Maximum number of persistent links. -1 means no limit. 15 | ; http://php.net/mysql.max-persistent 16 | mysql.max_persistent = -1 17 | 18 | ; Maximum number of links (persistent + non-persistent). -1 means no limit. 19 | ; http://php.net/mysql.max-links 20 | mysql.max_links = -1 21 | 22 | ; Default port number for mysql_connect(). If unset, mysql_connect() will use 23 | ; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or the 24 | ; compile-time value defined MYSQL_PORT (in that order). Win32 will only look 25 | ; at MYSQL_PORT. 26 | ; http://php.net/mysql.default-port 27 | mysql.default_port = 28 | 29 | ; Default socket name for local MySQL connects. If empty, uses the built-in 30 | ; MySQL defaults. 31 | ; http://php.net/mysql.default-socket 32 | mysql.default_socket = 33 | 34 | ; Default host for mysql_connect() (doesn't apply in safe mode). 35 | ; http://php.net/mysql.default-host 36 | mysql.default_host = 37 | 38 | ; Default user for mysql_connect() (doesn't apply in safe mode). 39 | ; http://php.net/mysql.default-user 40 | mysql.default_user = 41 | 42 | ; Default password for mysql_connect() (doesn't apply in safe mode). 43 | ; Note that this is generally a *bad* idea to store passwords in this file. 44 | ; *Any* user with PHP access can run 'echo get_cfg_var("mysql.default_password") 45 | ; and reveal this password! And of course, any users with read access to this 46 | ; file will be able to reveal the password as well. 47 | ; http://php.net/mysql.default-password 48 | mysql.default_password = 49 | 50 | ; Maximum time (in seconds) for connect timeout. -1 means no limit 51 | ; http://php.net/mysql.connect-timeout 52 | mysql.connect_timeout = 60 53 | 54 | ; Trace mode. When trace_mode is active (=On), warnings for table/index scans and 55 | ; SQL-Errors will be displayed. 56 | ; http://php.net/mysql.trace-mode 57 | mysql.trace_mode = Off 58 | 59 | -------------------------------------------------------------------------------- /app/Tasks/SetupMySQL.php: -------------------------------------------------------------------------------- 1 | //g;s/.*<\/td>//g;s///g;s/<\/t.>//g' 48 | assert 'default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline';' \ 49 | bash -c "curl -fsSL --user \"admin:$(get_jenkins_password)\" $(get_jenkins_url)/systemInfo | sed 's/<\/tr>/<\/tr>\'$'\n/g' | grep 'hudson.model.DirectoryBrowserSupport.CSP' | sed -e '${sed_expr}'" 50 | assert 'Europe/Madrid' \ 51 | bash -c "curl -fsSL --user \"admin:$(get_jenkins_password)\" $(get_jenkins_url)/systemInfo | sed 's/<\/tr>/<\/tr>\'$'\n/g' | grep 'user.timezone' | sed -e '${sed_expr}'" 52 | } 53 | 54 | @test "clean test containers" { 55 | cleanup $SUT_CONTAINER 56 | } 57 | -------------------------------------------------------------------------------- /config/logo.php: -------------------------------------------------------------------------------- 1 | true, 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Default Font 21 | |-------------------------------------------------------------------------- 22 | | 23 | | This option defines the font which should be used for rendering. 24 | | By default, one default font is shipped. However, you are free 25 | | to download and use additional fonts: http://www.figlet.org. 26 | | 27 | */ 28 | 29 | 'font' => \LaravelZero\Framework\Components\Logo\FigletString::DEFAULT_FONT, 30 | 31 | /* 32 | |-------------------------------------------------------------------------- 33 | | Output Width 34 | |-------------------------------------------------------------------------- 35 | | 36 | | This option defines the maximum width of the output string. This is 37 | | used for word-wrap as well as justification. Be careful when using 38 | | small values, because they may result in an undefined behavior. 39 | | 40 | */ 41 | 42 | 'outputWidth' => 80, 43 | 44 | /* 45 | |-------------------------------------------------------------------------- 46 | | Justification 47 | |-------------------------------------------------------------------------- 48 | | 49 | | This option defines the justification of the logo text. By default, 50 | | justification is provided, which will work well on most of your 51 | | console apps. Of course, you are free to change this value. 52 | | 53 | */ 54 | 55 | 'justification' => null, 56 | 57 | /* 58 | |-------------------------------------------------------------------------- 59 | | Right To Left 60 | |-------------------------------------------------------------------------- 61 | | 62 | | This option defines the option in which the text is written. By, default 63 | | the setting of the font-file is used. When justification is not defined, 64 | | a text written from right-to-left is automatically right-aligned. 65 | | 66 | | Possible values: "right-to-left", "left-to-right", null 67 | | 68 | */ 69 | 70 | 'rightToLeft' => null, 71 | 72 | ]; 73 | -------------------------------------------------------------------------------- /bin/laradock/jenkins/tests/test_helpers.bash: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # check dependencies 4 | ( 5 | type docker &>/dev/null || ( echo "docker is not available"; exit 1 ) 6 | type curl &>/dev/null || ( echo "curl is not available"; exit 1 ) 7 | )>&2 8 | 9 | # Assert that $1 is the outputof a command $2 10 | function assert { 11 | local expected_output=$1 12 | shift 13 | local actual_output 14 | actual_output=$("$@") 15 | actual_output="${actual_output//[$'\t\r\n']}" # remove newlines 16 | if ! [ "$actual_output" = "$expected_output" ]; then 17 | echo "expected: \"$expected_output\"" 18 | echo "actual: \"$actual_output\"" 19 | false 20 | fi 21 | } 22 | 23 | # Retry a command $1 times until it succeeds. Wait $2 seconds between retries. 24 | function retry { 25 | local attempts=$1 26 | shift 27 | local delay=$1 28 | shift 29 | local i 30 | 31 | for ((i=0; i < attempts; i++)); do 32 | run "$@" 33 | if [ "$status" -eq 0 ]; then 34 | return 0 35 | fi 36 | sleep $delay 37 | done 38 | 39 | echo "Command \"$*\" failed $attempts times. Status: $status. Output: $output" >&2 40 | false 41 | } 42 | 43 | function docker_build { 44 | if [ -n "$JENKINS_VERSION" ]; then 45 | docker build --build-arg JENKINS_VERSION=$JENKINS_VERSION --build-arg JENKINS_SHA=$JENKINS_SHA "$@" 46 | else 47 | docker build "$@" 48 | fi 49 | } 50 | 51 | function get_jenkins_url { 52 | if [ -z "${DOCKER_HOST}" ]; then 53 | DOCKER_IP=localhost 54 | else 55 | DOCKER_IP=$(echo "$DOCKER_HOST" | sed -e 's|tcp://\(.*\):[0-9]*|\1|') 56 | fi 57 | echo "http://$DOCKER_IP:$(docker port "$SUT_CONTAINER" 8080 | cut -d: -f2)" 58 | } 59 | 60 | function get_jenkins_password { 61 | docker logs "$SUT_CONTAINER" 2>&1 | grep -A 2 "Please use the following password to proceed to installation" | tail -n 1 62 | } 63 | 64 | function test_url { 65 | run curl --user "admin:$(get_jenkins_password)" --output /dev/null --silent --head --fail --connect-timeout 30 --max-time 60 "$(get_jenkins_url)$1" 66 | if [ "$status" -eq 0 ]; then 67 | true 68 | else 69 | echo "URL $(get_jenkins_url)$1 failed" >&2 70 | echo "output: $output" >&2 71 | false 72 | fi 73 | } 74 | 75 | function cleanup { 76 | docker kill "$1" &>/dev/null ||: 77 | docker rm -fv "$1" &>/dev/null ||: 78 | } 79 | 80 | function unzip_manifest { 81 | local plugin=$1 82 | local work=$2 83 | bash -c "docker run --rm -v $work:/var/jenkins_home --entrypoint unzip $SUT_IMAGE -p /var/jenkins_home/plugins/$plugin META-INF/MANIFEST.MF | tr -d '\r'" 84 | } 85 | -------------------------------------------------------------------------------- /bin/laradock/workspace/insecure_id_rsa.ppk: -------------------------------------------------------------------------------- 1 | PuTTY-User-Key-File-2: ssh-rsa 2 | Encryption: none 3 | Comment: imported-openssh-key 4 | Public-Lines: 12 5 | AAAAB3NzaC1yc2EAAAADAQABAAACAQD0tfQNVXxVjST53ny/5Op7ot+GeIGEGAEn 6 | r9kgYAXK6GqnJ/3UOfWKFxl4gEusLj4hpGrT/GJVx2nIG7d/IaRifJvns+Lak4Wj 7 | +17zyPRF54/mic6a0MAREJH5aTOLuSK+DhnhTUqAt4mfdHpYmBXWdTAXDCg8gP5Q 8 | LdGkdxL9M+GBk4tKiDx1hRfHV9uY6ci0lspQrhnPzzeWLktTA8uWYZlus1gv3SXX 9 | 6zVD2+XB6/J7ZarNcK9iHoMLddFggSdnGs6kNLJQe0DAwncdeCQizcdXV2A9O33v 10 | aY/b0A1obUxuoCit629AwyQ9C/71f3rBSrfgUSb1pOVPmhLRJDZenf/NS8FIW194 11 | /u5slvr1u6fj/iiCYctt0PNg00UAnlybWDDKD3l5e8Kbl16uTw1/5AEc6Wl3aCmt 12 | WYpwRGeue/hnUzOXr9/SjhQLfB+ZCASt83N+u0kV7ni7G5/04z11dqZwkk6x1SAz 13 | WGJnp76piwd4AP2fu8KqNAmWsyEIZmmR5JSGS5i4sGuSGog6rZWop1LwIfNjdOLF 14 | bs+rnF0oOmpgZReo8fH+PmOkq3iHaPQvXO3Cj2d52HVxtHI+n2iKjDu3CzHIP31v 15 | fqsZKHfmoo3ckFW4yfrPcXy0gQswPj0jJUIbKLb6OfuptUsQ5SvkiwWoW4irnO3l 16 | KF9KLo3t7w== 17 | Private-Lines: 28 18 | AAACADW3YzUyGLLm4sD+t7+fzmEJZaus9DE827QMg8r5iQv7bL34p11Yw69mVq7+ 19 | 6p2HIRhdcR3LfwJ5XZ0RiHwdtGnyFH8OG7QDQgi2+ybka8qUhCAFDBcrz51vV7u5 20 | /hijsR6rFb9BKiOLJmicNucPq2uCGeZVQtfVMP4EsMo7YS23n77D1oWr1imt54RY 21 | otm0J9yMZSjEruHRCNCspNg6Mwx1rCqCr88B6na1KOIWeR7SXk38CTxDihwtunJf 22 | kHBwqWeWmNmuv52vEI2/okoTv0rshN+FTJjkYEaXk36a8vaDV43JFmTnE2rR6ziD 23 | U5osO5QGhMp2xeiSI8wPdCX4nv5EKgL0+4a610IAhTa70KgUB8ommwqH6wZHKuLO 24 | 8PmGVLfUXvzOJ/tbm5uL2y6kDp60lhsr6bBwOwmCa1z6rnXGwfdPU4O9Fxu3O9gU 25 | TwnO5yE3ho+2xj5b/BpMNUN3KYW89KxiNfsGWrd+emDa4kq3NYQhAT6tjuALes2g 26 | 1IThgVsgCNMziQi4gWeRWrejYGZDtYeNvdRJ6WEXEE8nrucEwtLdKFcuPKK7bZTx 27 | HEpxs4qkSKa4IpFJUR2mw2emzeHbLxzY89ZZLssbMCIJ6kuNfCoct7gv9y/HxL0p 28 | lFdCd5qSQpOiC5Xs32nQ72muMlyRviOj3jWJoN6lVkgdu4/xAAABAQD68AEIqefw 29 | 8DhFaLE9wjJuPqJCkc/O3q5nG/eKXcihjcCebb4QduWgT1VwfemFAQChNCzF36Sh 30 | y0cep0mLpjE5OaaweXeOKUDeQqDQDtGKfvTYM5sLdz1VI57tX2uLM9CcV7CTIM+a 31 | k6hbdvLQNi/QMW0DzM1+BKQV6pkSgGdDIyib2UFhwn1UquJR90K8+CHdlX9LMR9y 32 | npm0wtG+0RbM7HvlzDDqQu9S5R6RCX/tRuvfo7P7vUHrpU3n251Itg8Bv6y3OFtB 33 | JTsts0pouXKAFESqdN5eP5UJcaevE5FlLUV+o726dvGD8VgEMEy3/aNe3oSXPrZi 34 | CMMS0aNxMD+tAAABAQD5pcpbrO58MbzwM+xfmmyXsK7YXCGrWPlQsa+mS65xpWyy 35 | c42YWqLiMfssRlWMRweDoaEOobK1ppSvUqFdVa22fSibapkgoWDsFHsTk9H0cq4i 36 | DR2jryk9//kwpPpMqrWAHWXwHjzV1Vzy2ZoeMdsvP1SUh/y4ttd8/URjIAMConjG 37 | 1A206Pu7PSTlrIiBZTqxwYLcSUtPN9a6xc8nJYU1XnAC0IjRe7hT8h007SsuIEjw 38 | FILxULgxrD9rVljWeWJcF+Oa0neLsDazfr5gbXW9eaLYEoVdrzQEzv4v3Om3F/Y+ 39 | /sfVi/LHht9VnbEJMsLKO1SPjAYaSYcxMLwzSCeLAAABAQC/gAQCLbqo4FylEVST 40 | 3IP8rxA5RGbLRDJ2j+ywEzOuy2ufGI/CfxeG/+jF5E0/uBRm8rrnMmaJaNr42hF4 41 | r5kjNM5uficOVucU3FluQqae73zfUFeAQBft+4tTH+sR8jo+LvEBGinW1wHv7di4 42 | 5I3at2HMjMtZgWPPIqCBIay0UKysW4eEwXYC9cWg9kPcb2y56zadrKxGZqHOPezH 43 | 2A1iOuzpvw0mG0xHUY4Eg5aZxcWB1jMf7bbxTAAMxQiBnw0bPEf5zpWzeKL0obxT 44 | /NhCgmV7/Fqs0GCbXEEgJo0zAVemALOAYRW3pYvt8FoCOopo4ADyfmdWlAvzCy46 45 | k7Fo 46 | Private-MAC: 4ea4cef3fa63f1068dcd512c477c61dd7e85bb38 47 | -------------------------------------------------------------------------------- /config/logging.php: -------------------------------------------------------------------------------- 1 | env('LOG_CHANNEL', 'stack'), 20 | 21 | /* 22 | |-------------------------------------------------------------------------- 23 | | Log Channels 24 | |-------------------------------------------------------------------------- 25 | | 26 | | Here you may configure the log channels for your application. Out of 27 | | the box, Laravel uses the Monolog PHP logging library. This gives 28 | | you a variety of powerful log handlers / formatters to utilize. 29 | | 30 | | Available Drivers: "single", "daily", "slack", "syslog", 31 | | "errorlog", "monolog", 32 | | "custom", "stack" 33 | | 34 | */ 35 | 36 | 'channels' => [ 37 | 'stack' => [ 38 | 'driver' => 'stack', 39 | 'channels' => ['stderr'], 40 | ], 41 | 42 | 'single' => [ 43 | 'driver' => 'single', 44 | 'path' => storage_path('logs/laravel.log'), 45 | 'level' => 'debug', 46 | ], 47 | 48 | 'daily' => [ 49 | 'driver' => 'daily', 50 | 'path' => storage_path('logs/laravel.log'), 51 | 'level' => 'debug', 52 | 'days' => 7, 53 | ], 54 | 55 | 'slack' => [ 56 | 'driver' => 'slack', 57 | 'url' => env('LOG_SLACK_WEBHOOK_URL'), 58 | 'username' => 'Laravel Log', 59 | 'emoji' => ':boom:', 60 | 'level' => 'critical', 61 | ], 62 | 63 | 'papertrail' => [ 64 | 'driver' => 'monolog', 65 | 'level' => 'debug', 66 | 'handler' => SyslogUdpHandler::class, 67 | 'handler_with' => [ 68 | 'host' => env('PAPERTRAIL_URL'), 69 | 'port' => env('PAPERTRAIL_PORT'), 70 | ], 71 | ], 72 | 73 | 'stderr' => [ 74 | 'driver' => 'monolog', 75 | 'handler' => StreamHandler::class, 76 | 'with' => [ 77 | 'stream' => 'php://stderr', 78 | ], 79 | ], 80 | 81 | 'syslog' => [ 82 | 'driver' => 'syslog', 83 | 'level' => 'debug', 84 | ], 85 | 86 | 'errorlog' => [ 87 | 'driver' => 'errorlog', 88 | 'level' => 'debug', 89 | ], 90 | ], 91 | 92 | ]; 93 | -------------------------------------------------------------------------------- /bin/laradock/sync.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This shell script is an optional tool to simplify 4 | # the installation and usage of laradock with docker-sync. 5 | 6 | # Make sure that the DOCKER_SYNC_STRATEGY is set in the .env 7 | # DOCKER_SYNC_STRATEGY=native_osx # osx 8 | # DOCKER_SYNC_STRATEGY=unison # windows 9 | 10 | # To run, make sure to add permissions to this file: 11 | # chmod 755 sync.sh 12 | 13 | # USAGE EXAMPLE: 14 | # Install docker-sync: ./sync.sh install 15 | # Start sync and services with nginx and mysql: ./sync.sh up nginx mysql 16 | # Stop containers and sync: ./sync.sh down 17 | 18 | # prints colored text 19 | print_style () { 20 | 21 | if [ "$2" == "info" ] ; then 22 | COLOR="96m" 23 | elif [ "$2" == "success" ] ; then 24 | COLOR="92m" 25 | elif [ "$2" == "warning" ] ; then 26 | COLOR="93m" 27 | elif [ "$2" == "danger" ] ; then 28 | COLOR="91m" 29 | else #default color 30 | COLOR="0m" 31 | fi 32 | 33 | STARTCOLOR="\e[$COLOR" 34 | ENDCOLOR="\e[0m" 35 | 36 | printf "$STARTCOLOR%b$ENDCOLOR" "$1" 37 | } 38 | 39 | display_options () { 40 | printf "Available options:\n"; 41 | print_style " install" "info"; printf "\t\t Installs docker-sync gem on the host machine.\n" 42 | print_style " up [services]" "success"; printf "\t Starts docker-sync and runs docker compose.\n" 43 | print_style " down" "success"; printf "\t\t\t Stops containers and docker-sync.\n" 44 | print_style " bash" "success"; printf "\t\t\t Opens bash on the workspace with user laradock.\n" 45 | print_style " sync" "info"; printf "\t\t\t Manually triggers the synchronization of files.\n" 46 | print_style " clean" "danger"; printf "\t\t Removes all files from docker-sync.\n" 47 | } 48 | 49 | if [[ $# -eq 0 ]] ; then 50 | print_style "Missing arguments.\n" "danger" 51 | display_options 52 | exit 1 53 | fi 54 | 55 | if [ "$1" == "up" ] ; then 56 | print_style "Initializing Docker Sync\n" "info" 57 | print_style "May take a long time (15min+) on the first run\n" "info" 58 | docker-sync start; 59 | 60 | print_style "Initializing Docker Compose\n" "info" 61 | shift # removing first argument 62 | docker-compose up -d ${@} 63 | 64 | elif [ "$1" == "down" ]; then 65 | print_style "Stopping Docker Compose\n" "info" 66 | docker-compose stop 67 | 68 | print_style "Stopping Docker Sync\n" "info" 69 | docker-sync stop 70 | 71 | elif [ "$1" == "bash" ]; then 72 | docker-compose exec --user=laradock workspace bash 73 | 74 | elif [ "$1" == "install" ]; then 75 | print_style "Installing docker-sync\n" "info" 76 | gem install docker-sync 77 | 78 | elif [ "$1" == "sync" ]; then 79 | print_style "Manually triggering sync between host and docker-sync container.\n" "info" 80 | docker-sync sync; 81 | 82 | elif [ "$1" == "clean" ]; then 83 | print_style "Removing and cleaning up files from the docker-sync container.\n" "warning" 84 | docker-sync clean 85 | else 86 | print_style "Invalid arguments.\n" "danger" 87 | display_options 88 | exit 1 89 | fi 90 | -------------------------------------------------------------------------------- /config/commands.php: -------------------------------------------------------------------------------- 1 | \Laradock\DockerCommands\DefaultCommand::class, 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Commands Paths 21 | |-------------------------------------------------------------------------- 22 | | 23 | | This value determines the "paths" that should be loaded by the console's 24 | | kernel. Foreach "path" present on the array provided below the kernel 25 | | will extract all "Illuminate\Console\Command" based class commands. 26 | | 27 | */ 28 | 29 | 'paths' => [ 30 | app_path('DockerCommands'), 31 | app_path('Commands'), 32 | ], 33 | 34 | /* 35 | |-------------------------------------------------------------------------- 36 | | Added Commands 37 | |-------------------------------------------------------------------------- 38 | | 39 | | You may want to include a single command class without having to load an 40 | | entire folder. Here you can specify which commands should be added to 41 | | your list of commands. The console's kernel will try to load them. 42 | | 43 | */ 44 | 45 | 'add' => [ 46 | // .. 47 | ], 48 | 49 | /* 50 | |-------------------------------------------------------------------------- 51 | | Hidden Commands 52 | |-------------------------------------------------------------------------- 53 | | 54 | | Your application commands will always be visible on the application list 55 | | of commands. But you can still make them "hidden" specifying an array 56 | | of commands below. All "hidden" commands can still be run/executed. 57 | | 58 | */ 59 | 60 | 'hidden' => [ 61 | NunoMaduro\LaravelConsoleSummary\SummaryCommand::class, 62 | Symfony\Component\Console\Command\HelpCommand::class, 63 | Illuminate\Console\Scheduling\ScheduleRunCommand::class, 64 | Illuminate\Console\Scheduling\ScheduleFinishCommand::class, 65 | Illuminate\Foundation\Console\VendorPublishCommand::class, 66 | ], 67 | 68 | /* 69 | |-------------------------------------------------------------------------- 70 | | Removed Commands 71 | |-------------------------------------------------------------------------- 72 | | 73 | | Do you have a service provider that loads a list of commands that 74 | | you don't need? No problem. Laravel Zero allows you to specify 75 | | below a list of commands that you don't to see in your app. 76 | | 77 | */ 78 | 79 | 'remove' => [ 80 | // .. 81 | ], 82 | 83 | ]; 84 | -------------------------------------------------------------------------------- /bin/laradock/php-fpm/xdebug: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | # NOTE: At the moment, this has only been confirmed to work with PHP 7 4 | 5 | 6 | # Grab full name of php-fpm container 7 | PHP_FPM_CONTAINER=$(docker ps | grep php-fpm | awk '{print $1}') 8 | 9 | 10 | # Grab OS type 11 | if [[ "$(uname)" == "Darwin" ]]; then 12 | OS_TYPE="OSX" 13 | else 14 | OS_TYPE=$(expr substr $(uname -s) 1 5) 15 | fi 16 | 17 | 18 | xdebug_status () 19 | { 20 | echo 'xDebug status' 21 | 22 | # If running on Windows, need to prepend with winpty :( 23 | if [[ $OS_TYPE == "MINGW" ]]; then 24 | winpty docker exec -it $PHP_FPM_CONTAINER bash -c 'php -v' 25 | 26 | else 27 | docker exec -it $PHP_FPM_CONTAINER bash -c 'php -v' 28 | fi 29 | 30 | } 31 | 32 | 33 | xdebug_start () 34 | { 35 | echo 'Start xDebug' 36 | 37 | # And uncomment line with xdebug extension, thus enabling it 38 | ON_CMD="sed -i 's/^;zend_extension=/zend_extension=/g' \ 39 | /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini" 40 | 41 | 42 | # If running on Windows, need to prepend with winpty :( 43 | if [[ $OS_TYPE == "MINGW" ]]; then 44 | winpty docker exec -it $PHP_FPM_CONTAINER bash -c "${ON_CMD}" 45 | docker restart $PHP_FPM_CONTAINER 46 | winpty docker exec -it $PHP_FPM_CONTAINER bash -c 'php -v' 47 | 48 | else 49 | docker exec -it $PHP_FPM_CONTAINER bash -c "${ON_CMD}" 50 | docker restart $PHP_FPM_CONTAINER 51 | docker exec -it $PHP_FPM_CONTAINER bash -c 'php -v' 52 | fi 53 | } 54 | 55 | 56 | xdebug_stop () 57 | { 58 | echo 'Stop xDebug' 59 | 60 | # Comment out xdebug extension line 61 | OFF_CMD="sed -i 's/^zend_extension=/;zend_extension=/g' /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini" 62 | 63 | 64 | # If running on Windows, need to prepend with winpty :( 65 | if [[ $OS_TYPE == "MINGW" ]]; then 66 | # This is the equivalent of: 67 | # winpty docker exec -it laradock_php-fpm_1 bash -c 'bla bla bla' 68 | # Thanks to @michaelarnauts at https://github.com/docker/compose/issues/593 69 | winpty docker exec -it $PHP_FPM_CONTAINER bash -c "${OFF_CMD}" 70 | docker restart $PHP_FPM_CONTAINER 71 | #docker-compose restart php-fpm 72 | winpty docker exec -it $PHP_FPM_CONTAINER bash -c 'php -v' 73 | 74 | else 75 | docker exec -it $PHP_FPM_CONTAINER bash -c "${OFF_CMD}" 76 | # docker-compose restart php-fpm 77 | docker restart $PHP_FPM_CONTAINER 78 | docker exec -it $PHP_FPM_CONTAINER bash -c 'php -v' 79 | fi 80 | } 81 | 82 | 83 | case $@ in 84 | stop|STOP) 85 | xdebug_stop 86 | ;; 87 | start|START) 88 | xdebug_start 89 | ;; 90 | status|STATUS) 91 | xdebug_status 92 | ;; 93 | *) 94 | echo "xDebug [Stop | Start | Status] in the ${PHP_FPM_CONTAINER} container." 95 | echo "xDebug must have already been installed." 96 | echo "Usage:" 97 | echo " .php-fpm/xdebug stop|start|status" 98 | 99 | esac 100 | 101 | exit 1 102 | -------------------------------------------------------------------------------- /bin/laradock/workspace/insecure_id_rsa: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | MIIJKQIBAAKCAgEA9LX0DVV8VY0k+d58v+Tqe6LfhniBhBgBJ6/ZIGAFyuhqpyf9 3 | 1Dn1ihcZeIBLrC4+IaRq0/xiVcdpyBu3fyGkYnyb57Pi2pOFo/te88j0ReeP5onO 4 | mtDAERCR+Wkzi7kivg4Z4U1KgLeJn3R6WJgV1nUwFwwoPID+UC3RpHcS/TPhgZOL 5 | Sog8dYUXx1fbmOnItJbKUK4Zz883li5LUwPLlmGZbrNYL90l1+s1Q9vlwevye2Wq 6 | zXCvYh6DC3XRYIEnZxrOpDSyUHtAwMJ3HXgkIs3HV1dgPTt972mP29ANaG1MbqAo 7 | retvQMMkPQv+9X96wUq34FEm9aTlT5oS0SQ2Xp3/zUvBSFtfeP7ubJb69bun4/4o 8 | gmHLbdDzYNNFAJ5cm1gwyg95eXvCm5derk8Nf+QBHOlpd2gprVmKcERnrnv4Z1Mz 9 | l6/f0o4UC3wfmQgErfNzfrtJFe54uxuf9OM9dXamcJJOsdUgM1hiZ6e+qYsHeAD9 10 | n7vCqjQJlrMhCGZpkeSUhkuYuLBrkhqIOq2VqKdS8CHzY3TixW7Pq5xdKDpqYGUX 11 | qPHx/j5jpKt4h2j0L1ztwo9nedh1cbRyPp9oiow7twsxyD99b36rGSh35qKN3JBV 12 | uMn6z3F8tIELMD49IyVCGyi2+jn7qbVLEOUr5IsFqFuIq5zt5ShfSi6N7e8CAwEA 13 | AQKCAgA1t2M1Mhiy5uLA/re/n85hCWWrrPQxPNu0DIPK+YkL+2y9+KddWMOvZlau 14 | /uqdhyEYXXEdy38CeV2dEYh8HbRp8hR/Dhu0A0IItvsm5GvKlIQgBQwXK8+db1e7 15 | uf4Yo7EeqxW/QSojiyZonDbnD6trghnmVULX1TD+BLDKO2Ett5++w9aFq9YpreeE 16 | WKLZtCfcjGUoxK7h0QjQrKTYOjMMdawqgq/PAep2tSjiFnke0l5N/Ak8Q4ocLbpy 17 | X5BwcKlnlpjZrr+drxCNv6JKE79K7ITfhUyY5GBGl5N+mvL2g1eNyRZk5xNq0es4 18 | g1OaLDuUBoTKdsXokiPMD3Ql+J7+RCoC9PuGutdCAIU2u9CoFAfKJpsKh+sGRyri 19 | zvD5hlS31F78zif7W5ubi9supA6etJYbK+mwcDsJgmtc+q51xsH3T1ODvRcbtzvY 20 | FE8JzuchN4aPtsY+W/waTDVDdymFvPSsYjX7Blq3fnpg2uJKtzWEIQE+rY7gC3rN 21 | oNSE4YFbIAjTM4kIuIFnkVq3o2BmQ7WHjb3USelhFxBPJ67nBMLS3ShXLjyiu22U 22 | 8RxKcbOKpEimuCKRSVEdpsNnps3h2y8c2PPWWS7LGzAiCepLjXwqHLe4L/cvx8S9 23 | KZRXQneakkKToguV7N9p0O9prjJckb4jo941iaDepVZIHbuP8QKCAQEA+vABCKnn 24 | 8PA4RWixPcIybj6iQpHPzt6uZxv3il3IoY3Anm2+EHbloE9VcH3phQEAoTQsxd+k 25 | octHHqdJi6YxOTmmsHl3jilA3kKg0A7Rin702DObC3c9VSOe7V9rizPQnFewkyDP 26 | mpOoW3by0DYv0DFtA8zNfgSkFeqZEoBnQyMom9lBYcJ9VKriUfdCvPgh3ZV/SzEf 27 | cp6ZtMLRvtEWzOx75cww6kLvUuUekQl/7Ubr36Oz+71B66VN59udSLYPAb+stzhb 28 | QSU7LbNKaLlygBREqnTeXj+VCXGnrxORZS1FfqO9unbxg/FYBDBMt/2jXt6Elz62 29 | YgjDEtGjcTA/rQKCAQEA+aXKW6zufDG88DPsX5psl7Cu2Fwhq1j5ULGvpkuucaVs 30 | snONmFqi4jH7LEZVjEcHg6GhDqGytaaUr1KhXVWttn0om2qZIKFg7BR7E5PR9HKu 31 | Ig0do68pPf/5MKT6TKq1gB1l8B481dVc8tmaHjHbLz9UlIf8uLbXfP1EYyADAqJ4 32 | xtQNtOj7uz0k5ayIgWU6scGC3ElLTzfWusXPJyWFNV5wAtCI0Xu4U/IdNO0rLiBI 33 | 8BSC8VC4Maw/a1ZY1nliXBfjmtJ3i7A2s36+YG11vXmi2BKFXa80BM7+L9zptxf2 34 | Pv7H1Yvyx4bfVZ2xCTLCyjtUj4wGGkmHMTC8M0gniwKCAQBYzQYQos/Jm7jOFzZh 35 | vI9MJC4XkLIRawwcwPDgrj+JrDg12HAiM3EfQfPiUyyIPMqUQXp2q6X++4i3eEu2 36 | d6GDtrseSF3emQqznLB78EKG2FadC+YaMKAruOdM6S+Nm1B/gyihaEMPWKGDfJyA 37 | wiw5aMRDS/6MUegfOV3iBj6Eq7R7Mm7IwaLIi5B7oRyk8spJN9ZMLZ4LWcTbCvZe 38 | qG+BJU7TC2dj/zviAeLHQK1csnRWOABBXcAuO9lN65HFYWf+Hm5oiDEC5MIEciYq 39 | 2TWDzahfCeyHPcjoBqhodGxHebXWEuvZSK4/GvEiylTb544gzG3vd+ni12bxCe7k 40 | 50YhAoIBAQCgG2r3dqYQspl49+P9wH0qn97S1eumB88FqJ99KIZ9Tlmy7Rb/ggl6 41 | xhFPaOBOsfMowY0YZC3IAEjVVEo3IM7i/cwAONJyMe2GGvCAMspxWudA4WaD5r+t 42 | irAXOYdpigYTX0dUQyBDB66v9Uy5VsI6wAQPqlMzZ9g1yfyFEi+8DdUltzP/NXjU 43 | sbcrMYbubazB+dhiTQNmj+pAKMLdWVvgSWvO8kz9BLrH47xFiGGsGHqOtqjv+RPY 44 | j56wyVT6YCjr5UpMrfSLevzqCzwvfaQIW61LpD0yQz46Y0J0Eds2WMDNz/r7guC2 45 | hFJRh2vV+V8h8gEeevAjBcsViir5PKpXAoIBAQC/gAQCLbqo4FylEVST3IP8rxA5 46 | RGbLRDJ2j+ywEzOuy2ufGI/CfxeG/+jF5E0/uBRm8rrnMmaJaNr42hF4r5kjNM5u 47 | ficOVucU3FluQqae73zfUFeAQBft+4tTH+sR8jo+LvEBGinW1wHv7di45I3at2HM 48 | jMtZgWPPIqCBIay0UKysW4eEwXYC9cWg9kPcb2y56zadrKxGZqHOPezH2A1iOuzp 49 | vw0mG0xHUY4Eg5aZxcWB1jMf7bbxTAAMxQiBnw0bPEf5zpWzeKL0obxT/NhCgmV7 50 | /Fqs0GCbXEEgJo0zAVemALOAYRW3pYvt8FoCOopo4ADyfmdWlAvzCy46k7Fo 51 | -----END RSA PRIVATE KEY----- 52 | -------------------------------------------------------------------------------- /bin/laradock/laravel-horizon/Dockerfile: -------------------------------------------------------------------------------- 1 | # 2 | #-------------------------------------------------------------------------- 3 | # Image Setup 4 | #-------------------------------------------------------------------------- 5 | # 6 | 7 | ARG PHP_VERSION=${PHP_VERSION} 8 | FROM php:${PHP_VERSION}-alpine 9 | 10 | LABEL maintainer="Mahmoud Zalt " 11 | 12 | RUN apk --update add wget \ 13 | curl \ 14 | git \ 15 | build-base \ 16 | libmemcached-dev \ 17 | libmcrypt-dev \ 18 | libxml2-dev \ 19 | zlib-dev \ 20 | autoconf \ 21 | cyrus-sasl-dev \ 22 | libgsasl-dev \ 23 | supervisor \ 24 | procps 25 | 26 | RUN docker-php-ext-install mysqli mbstring pdo pdo_mysql tokenizer xml pcntl 27 | RUN pecl channel-update pecl.php.net && pecl install memcached mcrypt-1.0.1 && docker-php-ext-enable memcached 28 | 29 | #Install BCMath package: 30 | ARG INSTALL_BCMATH=false 31 | RUN if [ ${INSTALL_BCMATH} = true ]; then \ 32 | docker-php-ext-install bcmath \ 33 | ;fi 34 | 35 | # Install PostgreSQL drivers: 36 | ARG INSTALL_PGSQL=false 37 | RUN if [ ${INSTALL_PGSQL} = true ]; then \ 38 | apk --update add postgresql-dev \ 39 | && docker-php-ext-install pdo_pgsql \ 40 | ;fi 41 | 42 | ########################################################################### 43 | # PHP Memcached: 44 | ########################################################################### 45 | 46 | ARG INSTALL_MEMCACHED=false 47 | 48 | RUN if [ ${INSTALL_MEMCACHED} = true ]; then \ 49 | # Install the php memcached extension 50 | if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then \ 51 | curl -L -o /tmp/memcached.tar.gz "https://github.com/php-memcached-dev/php-memcached/archive/2.2.0.tar.gz"; \ 52 | else \ 53 | curl -L -o /tmp/memcached.tar.gz "https://github.com/php-memcached-dev/php-memcached/archive/php7.tar.gz"; \ 54 | fi \ 55 | && mkdir -p memcached \ 56 | && tar -C memcached -zxvf /tmp/memcached.tar.gz --strip 1 \ 57 | && ( \ 58 | cd memcached \ 59 | && phpize \ 60 | && ./configure \ 61 | && make -j$(nproc) \ 62 | && make install \ 63 | ) \ 64 | && rm -r memcached \ 65 | && rm /tmp/memcached.tar.gz \ 66 | && docker-php-ext-enable memcached \ 67 | ;fi 68 | 69 | RUN rm /var/cache/apk/* \ 70 | && mkdir -p /var/www 71 | 72 | # 73 | #-------------------------------------------------------------------------- 74 | # Optional Supervisord Configuration 75 | #-------------------------------------------------------------------------- 76 | # 77 | # Modify the ./supervisor.conf file to match your App's requirements. 78 | # Make sure you rebuild your container with every change. 79 | # 80 | 81 | COPY supervisord.conf /etc/supervisord.conf 82 | 83 | ENTRYPOINT ["/usr/bin/supervisord", "-n", "-c", "/etc/supervisord.conf"] 84 | 85 | # 86 | #-------------------------------------------------------------------------- 87 | # Optional Software's Installation 88 | #-------------------------------------------------------------------------- 89 | # 90 | # If you need to modify this image, feel free to do it right here. 91 | # 92 | # -- Your awesome modifications go here -- # 93 | 94 | # 95 | #-------------------------------------------------------------------------- 96 | # Check PHP version 97 | #-------------------------------------------------------------------------- 98 | # 99 | 100 | RUN php -v | head -n 1 | grep -q "PHP ${PHP_VERSION}." 101 | 102 | # 103 | #-------------------------------------------------------------------------- 104 | # Final Touch 105 | #-------------------------------------------------------------------------- 106 | # 107 | 108 | WORKDIR /etc/supervisor/conf.d/ 109 | -------------------------------------------------------------------------------- /bin/laradock/php-fpm/xlaravel.pool.conf: -------------------------------------------------------------------------------- 1 | ; Unix user/group of processes 2 | ; Note: The user is mandatory. If the group is not set, the default user's group 3 | ; will be used. 4 | user = www-data 5 | group = www-data 6 | 7 | ; The address on which to accept FastCGI requests. 8 | ; Valid syntaxes are: 9 | ; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific address on 10 | ; a specific port; 11 | ; 'port' - to listen on a TCP socket to all addresses on a 12 | ; specific port; 13 | ; '/path/to/unix/socket' - to listen on a unix socket. 14 | ; Note: This value is mandatory. 15 | listen = 0.0.0.0:9000 16 | 17 | ; Choose how the process manager will control the number of child processes. 18 | ; Possible Values: 19 | ; static - a fixed number (pm.max_children) of child processes; 20 | ; dynamic - the number of child processes are set dynamically based on the 21 | ; following directives. With this process management, there will be 22 | ; always at least 1 children. 23 | ; pm.max_children - the maximum number of children that can 24 | ; be alive at the same time. 25 | ; pm.start_servers - the number of children created on startup. 26 | ; pm.min_spare_servers - the minimum number of children in 'idle' 27 | ; state (waiting to process). If the number 28 | ; of 'idle' processes is less than this 29 | ; number then some children will be created. 30 | ; pm.max_spare_servers - the maximum number of children in 'idle' 31 | ; state (waiting to process). If the number 32 | ; of 'idle' processes is greater than this 33 | ; number then some children will be killed. 34 | ; ondemand - no children are created at startup. Children will be forked when 35 | ; new requests will connect. The following parameter are used: 36 | ; pm.max_children - the maximum number of children that 37 | ; can be alive at the same time. 38 | ; pm.process_idle_timeout - The number of seconds after which 39 | ; an idle process will be killed. 40 | ; Note: This value is mandatory. 41 | pm = dynamic 42 | 43 | ; The number of child processes to be created when pm is set to 'static' and the 44 | ; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'. 45 | ; This value sets the limit on the number of simultaneous requests that will be 46 | ; served. Equivalent to the ApacheMaxClients directive with mpm_prefork. 47 | ; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP 48 | ; CGI. The below defaults are based on a server without much resources. Don't 49 | ; forget to tweak pm.* to fit your needs. 50 | ; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand' 51 | ; Note: This value is mandatory. 52 | pm.max_children = 20 53 | 54 | ; The number of child processes created on startup. 55 | ; Note: Used only when pm is set to 'dynamic' 56 | ; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2 57 | pm.start_servers = 2 58 | 59 | ; The desired minimum number of idle server processes. 60 | ; Note: Used only when pm is set to 'dynamic' 61 | ; Note: Mandatory when pm is set to 'dynamic' 62 | pm.min_spare_servers = 1 63 | 64 | ; The desired maximum number of idle server processes. 65 | ; Note: Used only when pm is set to 'dynamic' 66 | ; Note: Mandatory when pm is set to 'dynamic' 67 | pm.max_spare_servers = 3 68 | 69 | ;--------------------- 70 | 71 | ; Make specific Docker environment variables available to PHP 72 | env[DB_1_ENV_MYSQL_DATABASE] = $DB_1_ENV_MYSQL_DATABASE 73 | env[DB_1_ENV_MYSQL_USER] = $DB_1_ENV_MYSQL_USER 74 | env[DB_1_ENV_MYSQL_PASSWORD] = $DB_1_ENV_MYSQL_PASSWORD 75 | 76 | catch_workers_output = yes 77 | -------------------------------------------------------------------------------- /app/Transformers/EnvironmentConfigTransformer.php: -------------------------------------------------------------------------------- 1 | compose = $compose; 20 | } 21 | 22 | public function __invoke($line) 23 | { 24 | // Show comments for each services's section we're showing 25 | if (Str::startsWith($line, '### ')) { 26 | $keys = collect($this->compose->services)->keys()->map(function ($s) { 27 | return strtoupper($s); 28 | })->toArray(); 29 | foreach ($keys as $key) { 30 | // we add the comments in to be nice 31 | if (Str::contains($line, $key) || 32 | Str::contains($line, str_replace('-', '_', $key)) || 33 | // apache2 34 | Str::contains($line, str_replace('2', '', $key)) || 35 | Str::contains($line, 'Paths') || 36 | Str::contains($line, 'Drivers') 37 | ) { 38 | return $line; 39 | } 40 | } 41 | } 42 | 43 | // strip everything else 44 | if (! Str::contains($line, '=')) { 45 | return false; 46 | } 47 | 48 | // if 49 | $key = substr($line, 0, strpos($line, '=')); 50 | if (! isset($this->compose->matchedLaradockEnvs[$key])) { 51 | return false; 52 | } 53 | 54 | $value = substr($line, strpos($line, '=') + 1); 55 | if ($key === 'APP_CODE_PATH_HOST') { 56 | $value = './'; 57 | } 58 | if (Str::contains($key, 'PUID') && getmyuid() >= 1000) { 59 | $value = getmyuid(); 60 | } 61 | if (Str::contains($key, 'PGID') && getmygid() >= 1000) { 62 | $value = getmygid(); 63 | } 64 | if (Str::endsWith($key, '_LOG_PATH')) { 65 | $value = str_replace('./logs/', config('laradock.runtime_folder'), $value); 66 | } elseif (Str::endsWith($key, 'PATH')) { 67 | $value = config('laradock.context').'/'.str_replace('./', '', $value); 68 | } 69 | if ($key === 'MYSQL_ENTRYPOINT_INITDB') { 70 | $value = config('laradock.context').'/mysql/docker-entrypoint-initdb.d'; 71 | } 72 | if ($key === 'MARIADB_ENTRYPOINT_INITDB') { 73 | $value = config('laradock.context').'/mariadb/docker-entrypoint-initdb.d'; 74 | } 75 | if ($key === 'POSTGRES_ENTRYPOINT_INITDB') { 76 | $value = config('laradock.context').'/postgres/docker-entrypoint-initdb.d'; 77 | } 78 | if ($key === 'WORKSPACE_INSTALL_YARN') { 79 | $value = File::exists(workingDirectory('yarn.lock')) ? 'true' : 'false'; 80 | } 81 | if ($key === 'WORKSPACE_INSTALL_NODE') { 82 | $value = File::exists(workingDirectory('package.json')) ? 'true' : 'false'; 83 | } 84 | if ($key === 'WORKSPACE_INSTALL_NPM_GULP') { 85 | $value = File::exists(workingDirectory('gulp.json')) ? 'true' : 'false'; 86 | } 87 | 88 | // set the default php version based on CLI php version 89 | if ($key === 'PHP_VERSION') { 90 | if (PHP_MAJOR_VERSION === 7 && PHP_MINOR_VERSION <= 3) { 91 | $value = PHP_MAJOR_VERSION.'.'.PHP_MINOR_VERSION; 92 | } 93 | } 94 | // we shouldn't override the values 95 | if (isset($this->compose->laradockAttributes[$key])) { 96 | $value = $this->compose->laradockAttributes[$key]; 97 | } elseif (isset($this->compose->envAttributes[$key])) { 98 | $value = $this->compose->envAttributes[$key]; 99 | } 100 | // if the value has a space we need to wrap it in double-quotes 101 | if (Str::contains($value, ' ') && ! Str::startsWith($value, '"')) { 102 | $value = '"'.$value.'"'; 103 | } 104 | 105 | return $key.'='.$value; 106 | } 107 | } 108 | -------------------------------------------------------------------------------- /bin/laradock/jenkins/plugins.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | # Parse a support-core plugin -style txt file as specification for jenkins plugins to be installed 4 | # in the reference directory, so user can define a derived Docker image with just : 5 | # 6 | # FROM jenkins 7 | # COPY plugins.txt /plugins.txt 8 | # RUN /usr/local/bin/plugins.sh /plugins.txt 9 | # 10 | # Note: Plugins already installed are skipped 11 | # 12 | 13 | set -e 14 | 15 | echo "WARN: plugins.sh is deprecated, please switch to install-plugins.sh" 16 | 17 | if [ -z "$1" ] 18 | then 19 | echo " 20 | USAGE: 21 | Parse a support-core plugin -style txt file as specification for jenkins plugins to be installed 22 | in the reference directory, so user can define a derived Docker image with just : 23 | 24 | FROM jenkins 25 | COPY plugins.txt /plugins.txt 26 | RUN /usr/local/bin/plugins.sh /plugins.txt 27 | 28 | Note: Plugins already installed are skipped 29 | 30 | " 31 | exit 1 32 | else 33 | JENKINS_INPUT_JOB_LIST=$1 34 | if [ ! -f "$JENKINS_INPUT_JOB_LIST" ] 35 | then 36 | echo "ERROR File not found: $JENKINS_INPUT_JOB_LIST" 37 | exit 1 38 | fi 39 | fi 40 | 41 | # the war includes a # of plugins, to make the build efficient filter out 42 | # the plugins so we dont install 2x - there about 17! 43 | if [ -d "$JENKINS_HOME" ] 44 | then 45 | TEMP_ALREADY_INSTALLED=$JENKINS_HOME/preinstalled.plugins.$$.txt 46 | else 47 | echo "ERROR $JENKINS_HOME not found" 48 | exit 1 49 | fi 50 | 51 | JENKINS_PLUGINS_DIR=/var/jenkins_home/plugins 52 | if [ -d "$JENKINS_PLUGINS_DIR" ] 53 | then 54 | echo "Analyzing: $JENKINS_PLUGINS_DIR" 55 | for i in "$JENKINS_PLUGINS_DIR"/*/; do 56 | JENKINS_PLUGIN=$(basename "$i") 57 | JENKINS_PLUGIN_VER=$(egrep -i Plugin-Version "$i/META-INF/MANIFEST.MF"|cut -d: -f2|sed 's/ //') 58 | echo "$JENKINS_PLUGIN:$JENKINS_PLUGIN_VER" 59 | done >"$TEMP_ALREADY_INSTALLED" 60 | else 61 | JENKINS_WAR=/usr/share/jenkins/jenkins.war 62 | if [ -f "$JENKINS_WAR" ] 63 | then 64 | echo "Analyzing war: $JENKINS_WAR" 65 | TEMP_PLUGIN_DIR=/tmp/plugintemp.$$ 66 | while read -r i <&3; do 67 | rm -fr "$TEMP_PLUGIN_DIR" 68 | mkdir -p "$TEMP_PLUGIN_DIR" 69 | PLUGIN=$(basename "$i"|cut -f1 -d'.') 70 | (cd "$TEMP_PLUGIN_DIR" || exit; jar xf "$JENKINS_WAR" "$i"; jar xvf "$TEMP_PLUGIN_DIR/$i" META-INF/MANIFEST.MF >/dev/null 2>&1) 71 | VER=$(egrep -i Plugin-Version "$TEMP_PLUGIN_DIR/META-INF/MANIFEST.MF"|cut -d: -f2|sed 's/ //') 72 | echo "$PLUGIN:$VER" 73 | done 3< <(jar tf "$JENKINS_WAR" | egrep '[^detached-]plugins.*\..pi' | sort) > "$TEMP_ALREADY_INSTALLED" 74 | rm -fr "$TEMP_PLUGIN_DIR" 75 | else 76 | rm -f "$TEMP_ALREADY_INSTALLED" 77 | echo "ERROR file not found: $JENKINS_WAR" 78 | exit 1 79 | fi 80 | fi 81 | 82 | REF=/usr/share/jenkins/ref/plugins 83 | mkdir -p $REF 84 | COUNT_PLUGINS_INSTALLED=0 85 | while read -r spec || [ -n "$spec" ]; do 86 | 87 | plugin=(${spec//:/ }); 88 | [[ ${plugin[0]} =~ ^# ]] && continue 89 | [[ ${plugin[0]} =~ ^[[:space:]]*$ ]] && continue 90 | [[ -z ${plugin[1]} ]] && plugin[1]="latest" 91 | 92 | if [ -z "$JENKINS_UC_DOWNLOAD" ]; then 93 | JENKINS_UC_DOWNLOAD=$JENKINS_UC/download 94 | fi 95 | 96 | if ! grep -q "${plugin[0]}:${plugin[1]}" "$TEMP_ALREADY_INSTALLED" 97 | then 98 | echo "Downloading ${plugin[0]}:${plugin[1]}" 99 | curl --retry 3 --retry-delay 5 -sSL -f "${JENKINS_UC_DOWNLOAD}/plugins/${plugin[0]}/${plugin[1]}/${plugin[0]}.hpi" -o "$REF/${plugin[0]}.jpi" 100 | unzip -qqt "$REF/${plugin[0]}.jpi" 101 | (( COUNT_PLUGINS_INSTALLED += 1 )) 102 | else 103 | echo " ... skipping already installed: ${plugin[0]}:${plugin[1]}" 104 | fi 105 | done < "$JENKINS_INPUT_JOB_LIST" 106 | 107 | echo "---------------------------------------------------" 108 | if (( "$COUNT_PLUGINS_INSTALLED" > 0 )) 109 | then 110 | echo "INFO: Successfully installed $COUNT_PLUGINS_INSTALLED plugins." 111 | 112 | if [ -d $JENKINS_PLUGINS_DIR ] 113 | then 114 | echo "INFO: Please restart the container for changes to take effect!" 115 | fi 116 | else 117 | echo "INFO: No changes, all plugins previously installed." 118 | 119 | fi 120 | echo "---------------------------------------------------" 121 | 122 | #cleanup 123 | rm "$TEMP_ALREADY_INSTALLED" 124 | exit 0 125 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

2 | 3 |

4 | 5 | ⚠️ This project is no longer maintined or actively developed. Feel free to fork it and play around if you're interested in the idea. 6 | 7 | 8 | [![Total Downloads](https://img.shields.io/packagist/vpre/loonpwn/laradock-cli.svg?style=flat)](https://packagist.org/packages/loonpwn/laradock-cli) 9 | [![Total Downloads](https://img.shields.io/packagist/dt/loonpwn/laradock-cli.svg?style=flat)](https://packagist.org/packages/loonpwn/laradock-cli) 10 | [![StyleCI](https://github.styleci.io/repos/174919610/shield?branch=master)](https://github.styleci.io/repos/174919610) 11 | 12 | Laradock CLI is a tool for Laravel projects which automates the docker configuration setup for services, amongst other things. 13 | 14 | It is built with [Laravel Zero](https://laravel-zero.com/), on top of [Laradock](https://laradock.io/). 15 | 16 | ## Features 17 | 18 | #### Zero Configuration Docker 19 | 20 | Laradock CLI reads your `.env` and makes smart assumptions to reduce a lot of boilerplate configuration. Some examples: 21 | - Checks your driver settings and recommends which services are applicable 22 | - Fixes User and Group IDs 23 | - Checks for package.json before installing node in workspace 24 | - Checks your CLI php version for which php version to use 25 | - Modifies the apache2/nginx vhost site URL 26 | - Sets up your MySQL service with a database 27 | 28 | #### Clean project 29 | 30 | Laradock tends to have a larger footprint for the amount of code you use in your repository, Laradock CLI 31 | aims to fix this my only including the files for the services you are using. 32 | 33 | #### Clean .env 34 | 35 | All docker environment variables have been moved to their own `.env.laradock` file. No longer have a 300 line .env file. 36 | 37 | #### Easier Maintenance 38 | 39 | Simple command to add or remove services, Laradock CLI takes care of all the heavy lifting of setting up files, updating configuration, etc. 40 | 41 | #### Much More 42 | 43 | This project is in early development and has lots of planned updates coming. 44 | 45 | ------ 46 | 47 | ## Installation 48 | 49 | ### Phar 50 | 51 | ``` bash 52 | wget https://github.com/loonpwn/laradock-cli/releases/download/0.4.5/laradock 53 | chmod +x ./laradock 54 | ``` 55 | 56 | _Recommended: `sudo mv laradock /usr/bin/laradock`_ 57 | 58 | ## Usage 59 | 60 | 1. `laradock install` Run the setup tool 61 | 2. Check the `.env.laradock` and the files within `./env/docker` has the correct configuration for your project. 62 | 3. `laradock` Build and run the containers and then mount to the workspace container. 63 | 64 | ## Alpha Considerations 65 | 66 | Currently the following services have been setup to be automatically configured. If you use a service outside this list 67 | you will need to manually set it up per [Laradock documentation](https://laradock.io/). 68 | 69 | - Workspace 70 | - PHP-FPM 71 | - Nginx 72 | - Apache2 73 | - MySQL 74 | - MariaDB 75 | - PHPMyAdmin 76 | - Postgres 77 | - PGAdmin 78 | 79 | ## Documentation 80 | 81 | ### Laradock Commands 82 | 83 | - `laradock` 84 | This will start docker with `docker-compose up -d` and then mount you on the workspace container. 85 | - `laradock install` 86 | An interactive guide for setting up your project with Laradock CLI. 87 | - `laradock status` 88 | See which services you're currently using 89 | - `laradock services` 90 | List all Laradock services 91 | - `laradock add ` 92 | Add a specific service. 93 | - `laradock remove ` 94 | Remove a specific service. 95 | - `laradock workspace` 96 | Mounts yourself to the workspace container as Laradock user. 97 | - `laradock uninstall` 98 | Remove the Laradock CLI files from your project. 99 | 100 | ### DockerCompose Commands 101 | 102 | - `laradock up` 103 | Runs `docker-compose up -d` with the `.env.laradock` loaded in. 104 | - `laradock down` 105 | Runs `docker-compose down` with the `.env.laradock` loaded in. 106 | - `laradock build` 107 | Runs `docker-compose build` with the `.env.laradock` loaded in. 108 | - `laradock restart` 109 | Runs `docker-compose restart` with the `.env.laradock` loaded in. 110 | - `laradock push` 111 | Runs `docker-compose push` with the `.env.laradock` loaded in. 112 | - `laradock exec` 113 | Runs `docker-compose exec` with the `.env.laradock` loaded in. 114 | - `laradock ps` 115 | Runs `docker-compose ps` with the `.env.laradock` loaded in. 116 | -------------------------------------------------------------------------------- /app/Models/DockerCompose.php: -------------------------------------------------------------------------------- 1 | setAttribute('networks', []); 32 | } 33 | if (empty($attributes['volumes'])) { 34 | $this->setAttribute('volumes', []); 35 | } 36 | if (empty($attributes['services'])) { 37 | $this->setAttribute('services', []); 38 | } 39 | if (empty($attributes['path'])) { 40 | $this->setAttribute('path', config('laradock.compose_file')); 41 | } 42 | } 43 | 44 | public function isValidService($service) 45 | { 46 | return isset($this->services[$service]); 47 | } 48 | 49 | public function save() 50 | { 51 | $this->readCurrentEnvFile(); 52 | // save the docker-compose.yml file 53 | $this->writeToDockerComposeYaml(); 54 | // check for missing folders 55 | $this->addMissingFoldersForServices(); 56 | // handle dirty services, which were removed 57 | $this->deleteFoldersForServices(); 58 | // write the env file changes 59 | $this->writeEnvFile(); 60 | } 61 | 62 | public function readCurrentEnvFile() 63 | { 64 | $this->envAttributes = \Laradock\invoke(new ParseDotEnvFile()); 65 | $this->laradockAttributes = \Laradock\invoke(new ParseDotEnvFile(getLaradockCLIEnvPath(), '.env.laradock')); 66 | $this->laradockExampleContents = File::get(getLaradockEnvExamplePath()); 67 | preg_match_all('/\$\{(.*?)\}/m', json_encode([ 68 | 'services' => $this->services, 69 | 'networks' => $this->networks, 70 | 'volumes' => $this->volumes, 71 | ]), $matches, PREG_SET_ORDER, 0); 72 | $this->matchedLaradockEnvs = collect($matches)->map(function ($res) { 73 | return $res[1]; 74 | })->unique()->sort()->flip()->toArray(); 75 | } 76 | 77 | public function writeEnvFile() 78 | { 79 | $dotEnv = collect(explode("\n", $this->laradockExampleContents)) 80 | ->map(function ($line) { 81 | return \Laradock\invoke(new EnvironmentConfigTransformer($this), $line); 82 | }) 83 | ->filter(function ($line) { 84 | return ! empty($line); 85 | }) 86 | ->implode("\n"); 87 | 88 | File::put(getLaradockCLIEnvPath('.env.laradock'), $dotEnv); 89 | } 90 | 91 | public function writeToDockerComposeYaml() 92 | { 93 | $attrs = ['version' => '3']; 94 | $attrs = array_merge($attrs, collect($this->getAttributes()) 95 | ->only(['services', 'networks', 'volumes']) 96 | ->toArray()); 97 | File::put(getDockerComposePath(), Yaml::dump($attrs, 6, 2, Yaml::DUMP_OBJECT_AS_MAP)); 98 | } 99 | 100 | public function addMissingFoldersForServices() 101 | { 102 | if (! File::isDirectory(\Laradock\getServicesPath())) { 103 | File::makeDirectory(\Laradock\getServicesPath()); 104 | } 105 | collect($this->services)->keys()->each(function ($key) { 106 | if (empty($key)) { 107 | return; 108 | } 109 | if ( 110 | File::isDirectory(\Laradock\getLaradockServicePath($key)) 111 | ) { 112 | File::copyDirectory(\Laradock\getLaradockServicePath($key), \Laradock\getServicesPath($key)); 113 | } 114 | }); 115 | } 116 | 117 | public function deleteFoldersForServices() 118 | { 119 | if (empty($this->original['services'])) { 120 | return; 121 | } 122 | collect($this->original['services'])->keys()->filter(function ($key) { 123 | return ! isset($this->services[$key]); 124 | })->each(function ($key) { 125 | File::deleteDirectory(\Laradock\getServicesPath($key)); 126 | }); 127 | } 128 | } 129 | -------------------------------------------------------------------------------- /bin/laradock/jenkins/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM openjdk:8-jdk 2 | 3 | RUN apt-get update && apt-get install -y git curl && rm -rf /var/lib/apt/lists/* 4 | 5 | ENV JENKINS_HOME /var/jenkins_home 6 | ENV JENKINS_SLAVE_AGENT_PORT 50000 7 | 8 | ARG user=jenkins 9 | ARG group=jenkins 10 | ARG uid=1000 11 | ARG gid=1000 12 | 13 | # Jenkins is run with user `jenkins`, uid = 1000 14 | # If you bind mount a volume from the host or a data container, 15 | # ensure you use the same uid 16 | RUN groupadd -g ${gid} ${group} \ 17 | && useradd -d "$JENKINS_HOME" -u ${uid} -g ${gid} -m -s /bin/bash ${user} 18 | 19 | # Jenkins home directory is a volume, so configuration and build history 20 | # can be persisted and survive image upgrades 21 | VOLUME /var/jenkins_home 22 | 23 | # `/usr/share/jenkins/ref/` contains all reference configuration we want 24 | # to set on a fresh new installation. Use it to bundle additional plugins 25 | # or config file with your custom jenkins Docker image. 26 | RUN mkdir -p /usr/share/jenkins/ref/init.groovy.d 27 | 28 | ENV TINI_VERSION 0.16.1 29 | ENV TINI_SHA d1cb5d71adc01d47e302ea439d70c79bd0864288 30 | 31 | # Use tini as subreaper in Docker container to adopt zombie processes 32 | RUN curl -fsSL https://github.com/krallin/tini/releases/download/v${TINI_VERSION}/tini-static-amd64 -o /bin/tini && chmod +x /bin/tini \ 33 | && echo "$TINI_SHA /bin/tini" | sha1sum -c - 34 | 35 | COPY init.groovy /usr/share/jenkins/ref/init.groovy.d/tcp-slave-agent-port.groovy 36 | 37 | # jenkins version being bundled in this docker image 38 | ARG JENKINS_VERSION 39 | ENV JENKINS_VERSION ${JENKINS_VERSION:-2.89.2} 40 | 41 | # jenkins.war checksum, download will be validated using it 42 | # 2.89.2 43 | ARG JENKINS_SHA=014f669f32bc6e925e926e260503670b32662f006799b133a031a70a794c8a14 44 | 45 | 46 | # Can be used to customize where jenkins.war get downloaded from 47 | ARG JENKINS_URL=https://repo.jenkins-ci.org/public/org/jenkins-ci/main/jenkins-war/${JENKINS_VERSION}/jenkins-war-${JENKINS_VERSION}.war 48 | 49 | # could use ADD but this one does not check Last-Modified header neither does it allow to control checksum 50 | # see https://github.com/docker/docker/issues/8331 51 | RUN curl -fsSL ${JENKINS_URL} -o /usr/share/jenkins/jenkins.war \ 52 | && echo "${JENKINS_SHA} /usr/share/jenkins/jenkins.war" | sha256sum -c - 53 | 54 | ENV JENKINS_UC https://updates.jenkins.io 55 | RUN chown -R ${user} "$JENKINS_HOME" /usr/share/jenkins/ref 56 | 57 | 58 | # Add jenkins to the correct group 59 | # see http://stackoverflow.com/questions/42164653/docker-in-docker-permissions-error 60 | # use "getent group docker | awk -F: '{printf "%d\n", $3}'" command on host to find correct value for gid or simply use 'id' 61 | ARG DOCKER_GID=998 62 | 63 | RUN groupadd -g ${DOCKER_GID} docker \ 64 | && curl -sSL https://get.docker.com/ | sh \ 65 | && apt-get -q autoremove \ 66 | && apt-get -q clean -y \ 67 | && rm -rf /var/lib/apt/lists/* /var/cache/apt/*.bin 68 | 69 | # Install Docker-in-Docker from git@github.com:jpetazzo/dind.git 70 | # RUN apt-get update -qq && apt-get install -qqy apt-transport-https ca-certificates curl lxc iptables 71 | # Install Docker from Docker Inc. repositories. 72 | RUN apt-get install -y curl && curl -sSL https://get.docker.com/ | sh 73 | RUN usermod -aG docker jenkins 74 | 75 | # Install Docker-Compose 76 | RUN curl -L "https://github.com/docker/compose/releases/download/1.16.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose 77 | RUN chmod +x /usr/local/bin/docker-compose 78 | 79 | 80 | # for main web interface: 81 | EXPOSE 8080 82 | 83 | # will be used by attached slave agents: 84 | EXPOSE 50000 85 | 86 | ENV COPY_REFERENCE_FILE_LOG $JENKINS_HOME/copy_reference_file.log 87 | 88 | USER ${user} 89 | 90 | COPY jenkins-support /usr/local/bin/jenkins-support 91 | COPY jenkins.sh /usr/local/bin/jenkins.sh 92 | ENTRYPOINT ["/bin/tini", "--", "/usr/local/bin/jenkins.sh"] 93 | 94 | # from a derived Dockerfile, can use `RUN plugins.sh active.txt` to setup /usr/share/jenkins/ref/plugins from a support bundle 95 | COPY plugins.sh /usr/local/bin/plugins.sh 96 | COPY install-plugins.sh /usr/local/bin/install-plugins.sh 97 | 98 | # Only need below if we are starting from empty jenkins_home 99 | ## Copy the RSA keys 100 | #RUN mkdir -p /var/jenkins_home/.ssh 101 | #RUN chown jenkins:jenkins /var/jenkins_home/.ssh 102 | #COPY keys/id_rsa /var/jenkins_home/.ssh/id_rsa.pub 103 | #COPY keys/id_rsa /var/jenkins_home/.ssh/id_rsa 104 | #COPY keys/known_hosts /var/jenkins_home/.ssh/known_hosts 105 | # 106 | #USER root 107 | #RUN chmod 600 /var/jenkins_home/.ssh/id_rsa 108 | #RUN chmod 644 /var/jenkins_home/.ssh/id_rsa.pub 109 | ## ssh-keyscan -H github.com >> ~/.ssh/known_hosts 110 | ## ssh-keyscan -H bitbucket.org >> ~/.ssh/known_hosts 111 | 112 | # Fix docker permission denied error 113 | USER root 114 | RUN usermod -aG docker jenkins 115 | -------------------------------------------------------------------------------- /bin/laradock/jenkins/publish.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -eu 2 | 3 | # Publish any versions of the docker image not yet pushed to jenkinsci/jenkins 4 | # Arguments: 5 | # -n dry run, do not build or publish images 6 | 7 | set -o pipefail 8 | 9 | sort-versions() { 10 | if [ "$(uname)" == 'Darwin' ]; then 11 | gsort --version-sort 12 | else 13 | sort --version-sort 14 | fi 15 | } 16 | 17 | # Try tagging with and without -f to support all versions of docker 18 | docker-tag() { 19 | local from="jenkinsci/jenkins:$1" 20 | local to="jenkinsci/jenkins:$2" 21 | local out 22 | if out=$(docker tag -f "$from" "$to" 2>&1); then 23 | echo "$out" 24 | else 25 | docker tag "$from" "$to" 26 | fi 27 | } 28 | 29 | get-variant() { 30 | local branch 31 | branch=$(git show-ref | grep $(git rev-list -n 1 HEAD) | tail -1 | rev | cut -d/ -f 1 | rev) 32 | if [ -z "$branch" ]; then 33 | >&2 echo "Could not get the current branch name for commit, not in a branch?: $(git rev-list -n 1 HEAD)" 34 | return 1 35 | fi 36 | case "$branch" in 37 | master) echo "" ;; 38 | *) echo "-${branch}" ;; 39 | esac 40 | } 41 | 42 | login-token() { 43 | # could use jq .token 44 | curl -q -sSL https://auth.docker.io/token\?service\=registry.docker.io\&scope\=repository:jenkinsci/jenkins:pull | grep -o '"token":"[^"]*"' | cut -d':' -f 2 | xargs echo 45 | } 46 | 47 | is-published() { 48 | get-manifest "$1" &> /dev/null 49 | } 50 | 51 | get-manifest() { 52 | local tag=$1 53 | curl -q -fsSL -H "Accept: application/vnd.docker.distribution.manifest.v2+json" -H "Authorization: Bearer $TOKEN" "https://index.docker.io/v2/jenkinsci/jenkins/manifests/$tag" 54 | } 55 | 56 | get-digest() { 57 | #get-manifest "$1" | jq .config.digest 58 | get-manifest "$1" | grep -A 10 -o '"config".*' | grep digest | head -1 | cut -d':' -f 2,3 | xargs echo 59 | } 60 | 61 | get-latest-versions() { 62 | curl -q -fsSL https://api.github.com/repos/jenkinsci/jenkins/tags?per_page=20 | grep '"name": "jenkins-' | egrep -o '[0-9]+(\.[0-9]+)+' | sort-versions | uniq 63 | } 64 | 65 | publish() { 66 | local version=$1 67 | local variant=$2 68 | local tag="${version}${variant}" 69 | local sha 70 | local build_opts="--no-cache --pull" 71 | 72 | sha=$(curl -q -fsSL "http://repo.jenkins-ci.org/simple/releases/org/jenkins-ci/main/jenkins-war/${version}/jenkins-war-${version}.war.sha1") 73 | 74 | docker build --build-arg "JENKINS_VERSION=$version" \ 75 | --build-arg "JENKINS_SHA=$sha" \ 76 | --tag "jenkinsci/jenkins:${tag}" ${build_opts} . 77 | 78 | docker push "jenkinsci/jenkins:${tag}" 79 | } 80 | 81 | tag-and-push() { 82 | local source=$1 83 | local target=$2 84 | local digest_source; digest_source=$(get-digest ${tag1}) 85 | local digest_target; digest_target=$(get-digest ${tag2}) 86 | if [ "$digest_source" == "$digest_target" ]; then 87 | echo "Images ${source} [$digest_source] and ${target} [$digest_target] are already the same, not updating tags" 88 | else 89 | echo "Creating tag ${target} pointing to ${source}" 90 | if [ ! "$dry_run" = true ]; then 91 | docker-tag "jenkinsci/jenkins:${source}" "jenkinsci/jenkins:${target}" 92 | docker push "jenkinsci/jenkins:${source}" 93 | fi 94 | fi 95 | } 96 | 97 | publish-latest() { 98 | local version=$1 99 | local variant=$2 100 | 101 | # push latest (for master) or the name of the branch (for other branches) 102 | if [ -z "${variant}" ]; then 103 | tag-and-push "${version}${variant}" "latest" 104 | else 105 | tag-and-push "${version}${variant}" "${variant#-}" 106 | fi 107 | } 108 | 109 | publish-lts() { 110 | local version=$1 111 | local variant=$2 112 | tag-and-push "${version}" "lts${variant}" 113 | } 114 | 115 | dry_run=false 116 | if [ "-n" == "${1:-}" ]; then 117 | dry_run=true 118 | fi 119 | if [ "$dry_run" = true ]; then 120 | echo "Dry run, will not build or publish images" 121 | fi 122 | 123 | TOKEN=$(login-token) 124 | 125 | variant=$(get-variant) 126 | 127 | lts_version="" 128 | version="" 129 | for version in $(get-latest-versions); do 130 | if is-published "$version$variant"; then 131 | echo "Tag is already published: $version$variant" 132 | else 133 | echo "Publishing version: $version$variant" 134 | if [ ! "$dry_run" = true ]; then 135 | publish "$version" "$variant" 136 | fi 137 | fi 138 | 139 | # Update lts tag 140 | if [[ "$version" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then 141 | lts_version="${version}" 142 | fi 143 | done 144 | 145 | publish-latest "${version}" "${variant}" 146 | if [ -n "${lts_version}" ]; then 147 | publish-lts "${lts_version}" "${variant}" 148 | fi 149 | -------------------------------------------------------------------------------- /bin/laradock/jenkins/tests/install-plugins.bats: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bats 2 | 3 | SUT_IMAGE=bats-jenkins 4 | 5 | load 'test_helper/bats-support/load' 6 | load 'test_helper/bats-assert/load' 7 | load test_helpers 8 | 9 | @test "build image" { 10 | cd $BATS_TEST_DIRNAME/.. 11 | docker_build -t $SUT_IMAGE . 12 | } 13 | 14 | @test "plugins are installed with plugins.sh" { 15 | run docker build -t $SUT_IMAGE-plugins $BATS_TEST_DIRNAME/plugins 16 | assert_success 17 | # replace DOS line endings \r\n 18 | run bash -c "docker run --rm $SUT_IMAGE-plugins ls --color=never -1 /var/jenkins_home/plugins | tr -d '\r'" 19 | assert_success 20 | assert_line 'maven-plugin.jpi' 21 | assert_line 'maven-plugin.jpi.pinned' 22 | assert_line 'ant.jpi' 23 | assert_line 'ant.jpi.pinned' 24 | } 25 | 26 | @test "plugins are installed with install-plugins.sh" { 27 | run docker build -t $SUT_IMAGE-install-plugins $BATS_TEST_DIRNAME/install-plugins 28 | assert_success 29 | refute_line --partial 'Skipping already bundled dependency' 30 | # replace DOS line endings \r\n 31 | run bash -c "docker run --rm $SUT_IMAGE-install-plugins ls --color=never -1 /var/jenkins_home/plugins | tr -d '\r'" 32 | assert_success 33 | assert_line 'maven-plugin.jpi' 34 | assert_line 'maven-plugin.jpi.pinned' 35 | assert_line 'ant.jpi' 36 | assert_line 'ant.jpi.pinned' 37 | assert_line 'credentials.jpi' 38 | assert_line 'credentials.jpi.pinned' 39 | assert_line 'mesos.jpi' 40 | assert_line 'mesos.jpi.pinned' 41 | # optional dependencies 42 | refute_line 'metrics.jpi' 43 | refute_line 'metrics.jpi.pinned' 44 | # plugins bundled but under detached-plugins, so need to be installed 45 | assert_line 'javadoc.jpi' 46 | assert_line 'javadoc.jpi.pinned' 47 | assert_line 'mailer.jpi' 48 | assert_line 'mailer.jpi.pinned' 49 | } 50 | 51 | @test "plugins are installed with install-plugins.sh even when already exist" { 52 | run docker build -t $SUT_IMAGE-install-plugins-update --no-cache $BATS_TEST_DIRNAME/install-plugins/update 53 | assert_success 54 | assert_line "Using provided plugin: ant" 55 | refute_line --partial 'Skipping already bundled dependency' 56 | # replace DOS line endings \r\n 57 | run bash -c "docker run --rm $SUT_IMAGE-install-plugins-update unzip -p /var/jenkins_home/plugins/maven-plugin.jpi META-INF/MANIFEST.MF | tr -d '\r'" 58 | assert_success 59 | assert_line 'Plugin-Version: 2.13' 60 | } 61 | 62 | @test "plugins are getting upgraded but not downgraded" { 63 | # Initial execution 64 | run docker build -t $SUT_IMAGE-install-plugins $BATS_TEST_DIRNAME/install-plugins 65 | assert_success 66 | local work; work="$BATS_TEST_DIRNAME/upgrade-plugins/work" 67 | mkdir -p $work 68 | # Image contains maven-plugin 2.7.1 and ant-plugin 1.3 69 | run bash -c "docker run -u $UID -v $work:/var/jenkins_home --rm $SUT_IMAGE-install-plugins true" 70 | assert_success 71 | run unzip_manifest maven-plugin.jpi $work 72 | assert_line 'Plugin-Version: 2.7.1' 73 | run unzip_manifest ant.jpi $work 74 | assert_line 'Plugin-Version: 1.3' 75 | 76 | # Upgrade to new image with different plugins 77 | run docker build -t $SUT_IMAGE-upgrade-plugins $BATS_TEST_DIRNAME/upgrade-plugins 78 | assert_success 79 | # Images contains maven-plugin 2.13 and ant-plugin 1.2 80 | run bash -c "docker run -u $UID -v $work:/var/jenkins_home --rm $SUT_IMAGE-upgrade-plugins true" 81 | assert_success 82 | run unzip_manifest maven-plugin.jpi $work 83 | assert_success 84 | # Should be updated 85 | assert_line 'Plugin-Version: 2.13' 86 | run unzip_manifest ant.jpi $work 87 | # 1.2 is older than the existing 1.3, so keep 1.3 88 | assert_line 'Plugin-Version: 1.3' 89 | } 90 | 91 | @test "clean work directory" { 92 | run bash -c "rm -rf $BATS_TEST_DIRNAME/upgrade-plugins/work" 93 | } 94 | 95 | @test "do not upgrade if plugin has been manually updated" { 96 | run docker build -t $SUT_IMAGE-install-plugins $BATS_TEST_DIRNAME/install-plugins 97 | assert_success 98 | local work; work="$BATS_TEST_DIRNAME/upgrade-plugins/work" 99 | mkdir -p $work 100 | # Image contains maven-plugin 2.7.1 and ant-plugin 1.3 101 | run bash -c "docker run -u $UID -v $work:/var/jenkins_home --rm $SUT_IMAGE-install-plugins curl --connect-timeout 20 --retry 5 --retry-delay 0 --retry-max-time 60 -s -f -L https://updates.jenkins.io/download/plugins/maven-plugin/2.12.1/maven-plugin.hpi -o /var/jenkins_home/plugins/maven-plugin.jpi" 102 | assert_success 103 | run unzip_manifest maven-plugin.jpi $work 104 | assert_line 'Plugin-Version: 2.12.1' 105 | run docker build -t $SUT_IMAGE-upgrade-plugins $BATS_TEST_DIRNAME/upgrade-plugins 106 | assert_success 107 | # Images contains maven-plugin 2.13 and ant-plugin 1.2 108 | run bash -c "docker run -u $UID -v $work:/var/jenkins_home --rm $SUT_IMAGE-upgrade-plugins true" 109 | assert_success 110 | run unzip_manifest maven-plugin.jpi $work 111 | assert_success 112 | # Shouldn't be updated 113 | refute_line 'Plugin-Version: 2.13' 114 | } 115 | 116 | @test "clean work directory" { 117 | run bash -c "rm -rf $BATS_TEST_DIRNAME/upgrade-plugins/work" 118 | } 119 | -------------------------------------------------------------------------------- /app/Models/OfflineModel.php: -------------------------------------------------------------------------------- 1 | original = $this->attributes; 39 | 40 | return $this; 41 | } 42 | 43 | public function getVisible() 44 | { 45 | return $this->attributes; 46 | } 47 | 48 | public function relationsToArray() 49 | { 50 | return []; 51 | } 52 | 53 | public function getArrayableItems($values) 54 | { 55 | return $values; 56 | } 57 | 58 | public function usesTimestamps() 59 | { 60 | return false; 61 | } 62 | 63 | public function getIncrementing() 64 | { 65 | return false; 66 | } 67 | 68 | /** 69 | * The name of the "created at" column. 70 | * 71 | * @var string 72 | */ 73 | const CREATED_AT = 'created_at'; 74 | 75 | /** 76 | * The name of the "updated at" column. 77 | * 78 | * @var string 79 | */ 80 | const UPDATED_AT = 'updated_at'; 81 | 82 | /** 83 | * Create a new Eloquent model instance. 84 | * 85 | * @param array $attributes 86 | * @return void 87 | */ 88 | public function __construct(array $attributes = []) 89 | { 90 | $this->attributes = $attributes; 91 | $this->syncOriginal(); 92 | } 93 | 94 | /** 95 | * Dynamically retrieve attributes on the model. 96 | * 97 | * @param string $key 98 | * @return mixed 99 | */ 100 | public function __get($key) 101 | { 102 | return $this->getAttribute($key); 103 | } 104 | 105 | /** 106 | * Dynamically set attributes on the model. 107 | * 108 | * @param string $key 109 | * @param mixed $value 110 | * @return void 111 | */ 112 | public function __set($key, $value) 113 | { 114 | $this->setAttribute($key, $value); 115 | } 116 | 117 | /** 118 | * Get an attribute from the model. 119 | * 120 | * @param string $key 121 | * @return mixed 122 | */ 123 | public function getAttribute($key) 124 | { 125 | return $this->attributes[$key]; 126 | } 127 | 128 | /** 129 | * Get an attribute from the model. 130 | * 131 | * @param string $key 132 | * @return mixed 133 | */ 134 | public function setAttribute($key, $value) 135 | { 136 | return $this->attributes[$key] = $value; 137 | } 138 | 139 | /** 140 | * Determine if the given attribute exists. 141 | * 142 | * @param mixed $offset 143 | * @return bool 144 | */ 145 | public function offsetExists($offset) 146 | { 147 | return ! is_null($this->getAttribute($offset)); 148 | } 149 | 150 | /** 151 | * Get the value for a given offset. 152 | * 153 | * @param mixed $offset 154 | * @return mixed 155 | */ 156 | public function offsetGet($offset) 157 | { 158 | return $this->getAttribute($offset); 159 | } 160 | 161 | /** 162 | * Set the value for a given offset. 163 | * 164 | * @param mixed $offset 165 | * @param mixed $value 166 | * @return void 167 | */ 168 | public function offsetSet($offset, $value) 169 | { 170 | $this->setAttribute($offset, $value); 171 | } 172 | 173 | /** 174 | * Unset the value for a given offset. 175 | * 176 | * @param mixed $offset 177 | * @return void 178 | */ 179 | public function offsetUnset($offset) 180 | { 181 | unset($this->attributes[$offset], $this->relations[$offset]); 182 | } 183 | 184 | /** 185 | * Determine if an attribute or relation exists on the model. 186 | * 187 | * @param string $key 188 | * @return bool 189 | */ 190 | public function __isset($key) 191 | { 192 | return $this->offsetExists($key); 193 | } 194 | 195 | /** 196 | * Unset an attribute on the model. 197 | * 198 | * @param string $key 199 | * @return void 200 | */ 201 | public function __unset($key) 202 | { 203 | $this->offsetUnset($key); 204 | } 205 | 206 | /** 207 | * Handle dynamic static method calls into the method. 208 | * 209 | * @param string $method 210 | * @param array $parameters 211 | * @return mixed 212 | */ 213 | public static function __callStatic($method, $parameters) 214 | { 215 | return (new static)->$method(...$parameters); 216 | } 217 | 218 | public function getAttributes() 219 | { 220 | return $this->attributes; 221 | } 222 | 223 | /** 224 | * Convert the model instance to an array. 225 | * 226 | * @return array 227 | */ 228 | public function toArray() 229 | { 230 | return $this->attributes; 231 | } 232 | } 233 | -------------------------------------------------------------------------------- /bin/laradock/jenkins/jenkins-support: -------------------------------------------------------------------------------- 1 | #!/bin/bash -eu 2 | 3 | # compare if version1 < version2 4 | versionLT() { 5 | local v1; v1=$(echo "$1" | cut -d '-' -f 1 ) 6 | local q1; q1=$(echo "$1" | cut -s -d '-' -f 2- ) 7 | local v2; v2=$(echo "$2" | cut -d '-' -f 1 ) 8 | local q2; q2=$(echo "$2" | cut -s -d '-' -f 2- ) 9 | if [ "$v1" = "$v2" ]; then 10 | if [ "$q1" = "$q2" ]; then 11 | return 1 12 | else 13 | if [ -z "$q1" ]; then 14 | return 1 15 | else 16 | if [ -z "$q2" ]; then 17 | return 0 18 | else 19 | [ "$q1" = "$(echo -e "$q1\n$q2" | sort -V | head -n1)" ] 20 | fi 21 | fi 22 | fi 23 | else 24 | [ "$v1" = "$(echo -e "$v1\n$v2" | sort -V | head -n1)" ] 25 | fi 26 | } 27 | 28 | # returns a plugin version from a plugin archive 29 | get_plugin_version() { 30 | local archive; archive=$1 31 | local version; version=$(unzip -p "$archive" META-INF/MANIFEST.MF | grep "^Plugin-Version: " | sed -e 's#^Plugin-Version: ##') 32 | version=${version%%[[:space:]]} 33 | echo "$version" 34 | } 35 | 36 | # Copy files from /usr/share/jenkins/ref into $JENKINS_HOME 37 | # So the initial JENKINS-HOME is set with expected content. 38 | # Don't override, as this is just a reference setup, and use from UI 39 | # can then change this, upgrade plugins, etc. 40 | copy_reference_file() { 41 | f="${1%/}" 42 | b="${f%.override}" 43 | rel="${b:23}" 44 | version_marker="${rel}.version_from_image" 45 | dir=$(dirname "${b}") 46 | local action; 47 | local reason; 48 | local container_version; 49 | local image_version; 50 | local marker_version; 51 | local log; log=false 52 | if [[ ${rel} == plugins/*.jpi ]]; then 53 | container_version=$(get_plugin_version "$JENKINS_HOME/${rel}") 54 | image_version=$(get_plugin_version "${f}") 55 | if [[ -e $JENKINS_HOME/${version_marker} ]]; then 56 | marker_version=$(cat "$JENKINS_HOME/${version_marker}") 57 | if versionLT "$marker_version" "$container_version"; then 58 | action="SKIPPED" 59 | reason="Installed version ($container_version) has been manually upgraded from initial version ($marker_version)" 60 | log=true 61 | else 62 | if [[ "$image_version" == "$container_version" ]]; then 63 | action="SKIPPED" 64 | reason="Version from image is the same as the installed version $image_version" 65 | else 66 | if versionLT "$image_version" "$container_version"; then 67 | action="SKIPPED" 68 | log=true 69 | reason="Image version ($image_version) is older than installed version ($container_version)" 70 | else 71 | action="UPGRADED" 72 | log=true 73 | reason="Image version ($image_version) is newer than installed version ($container_version)" 74 | fi 75 | fi 76 | fi 77 | else 78 | if [[ -n "$TRY_UPGRADE_IF_NO_MARKER" ]]; then 79 | if [[ "$image_version" == "$container_version" ]]; then 80 | action="SKIPPED" 81 | reason="Version from image is the same as the installed version $image_version (no marker found)" 82 | # Add marker for next time 83 | echo "$image_version" > "$JENKINS_HOME/${version_marker}" 84 | else 85 | if versionLT "$image_version" "$container_version"; then 86 | action="SKIPPED" 87 | log=true 88 | reason="Image version ($image_version) is older than installed version ($container_version) (no marker found)" 89 | else 90 | action="UPGRADED" 91 | log=true 92 | reason="Image version ($image_version) is newer than installed version ($container_version) (no marker found)" 93 | fi 94 | fi 95 | fi 96 | fi 97 | if [[ ! -e $JENKINS_HOME/${rel} || "$action" == "UPGRADED" || $f = *.override ]]; then 98 | action=${action:-"INSTALLED"} 99 | log=true 100 | mkdir -p "$JENKINS_HOME/${dir:23}" 101 | cp -r "${f}" "$JENKINS_HOME/${rel}"; 102 | # pin plugins on initial copy 103 | touch "$JENKINS_HOME/${rel}.pinned" 104 | echo "$image_version" > "$JENKINS_HOME/${version_marker}" 105 | reason=${reason:-$image_version} 106 | else 107 | action=${action:-"SKIPPED"} 108 | fi 109 | else 110 | if [[ ! -e $JENKINS_HOME/${rel} || $f = *.override ]] 111 | then 112 | action="INSTALLED" 113 | log=true 114 | mkdir -p "$JENKINS_HOME/${dir:23}" 115 | cp -r "${f}" "$JENKINS_HOME/${rel}"; 116 | else 117 | action="SKIPPED" 118 | fi 119 | fi 120 | if [[ -n "$VERBOSE" || "$log" == "true" ]]; then 121 | if [ -z "$reason" ]; then 122 | echo "$action $rel" >> "$COPY_REFERENCE_FILE_LOG" 123 | else 124 | echo "$action $rel : $reason" >> "$COPY_REFERENCE_FILE_LOG" 125 | fi 126 | fi 127 | } --------------------------------------------------------------------------------