Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
09a2b62
Refactor dependencies for API Services.
michaeljoelphillips Apr 25, 2017
9a654da
Update Docker environment.
michaeljoelphillips May 21, 2017
6077d17
Update Symfony to 3.2.
michaeljoelphillips May 21, 2017
bafa37b
Update Docker Compose and add Docker Sync configuration.
michaeljoelphillips May 21, 2017
383b221
Misc edits.
michaeljoelphillips May 21, 2017
8aa9457
Added uncommitted test.
michaeljoelphillips May 21, 2017
62ab6b8
Another misc change commit.
michaeljoelphillips May 21, 2017
2d92a0c
Move service tests and update AvailApi test.
michaeljoelphillips May 21, 2017
440cdba
Remove old, unused test.
michaeljoelphillips May 21, 2017
cd343aa
Add travis.yml file.
michaeljoelphillips May 21, 2017
6c95716
Add SSH2 extension to Travis build.
michaeljoelphillips May 21, 2017
c68c679
Add libsh2 to Travis build.
michaeljoelphillips May 21, 2017
498bb0d
Run as sudo user.
michaeljoelphillips May 21, 2017
14ffeb8
Non interactive pecl install.
michaeljoelphillips May 21, 2017
9af9d24
Attempting non-interactive install again.
michaeljoelphillips May 21, 2017
9056737
Add composer install.
michaeljoelphillips May 21, 2017
9d5952e
Add var directory.
michaeljoelphillips May 21, 2017
e4004a2
Mock vendor API.
michaeljoelphillips May 21, 2017
07debb0
Add clover code coverage to PHPUnit.
michaeljoelphillips May 21, 2017
00b9f50
Add CodeCov.io.
michaeljoelphillips May 21, 2017
c5b41b4
Update coverage filename.
michaeljoelphillips May 21, 2017
32a8f66
Add badges to README.
michaeljoelphillips May 21, 2017
4f73025
Add test for ApiFactory.
michaeljoelphillips May 21, 2017
8c60132
Add MigrateType test.
michaeljoelphillips May 21, 2017
62adfec
Commit missing form changes.
michaeljoelphillips May 21, 2017
4614e38
Fix PHP7 SFTP issue.
michaeljoelphillips May 21, 2017
c7fd1d9
Convert badges to master branch.
michaeljoelphillips May 21, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .docker/includes.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Aliases for common commands

alias symfony-console="docker-compose exec php php /app/bin/console"
alias dcomposer="docker-compose exec php composer --working-dir=/app/"
alias dphpunit="docker-compose exec php php -d memory_limit=-1 /app/vendor/bin/phpunit -c /app/"
11 changes: 11 additions & 0 deletions .docker/nginx/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM nginx

MAINTAINER Michael Phillips <michael.phillips@manpow.com>

COPY bin/entrypoint.sh /usr/local/bin
RUN chmod +x /usr/local/bin/entrypoint.sh
COPY conf/vhost_dev.conf /etc/nginx/nginx.conf.dev
COPY conf/vhost_prod.conf /etc/nginx/nginx.conf.prod
ENV ENVIRONMENT dev

ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
10 changes: 10 additions & 0 deletions .docker/nginx/bin/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash
set -e

if [ -z "$1" ]; then
cp /etc/nginx/nginx.conf.${ENVIRONMENT} /etc/nginx/nginx.conf
exec nginx -g "daemon off;"
fi

exec "$@"

63 changes: 63 additions & 0 deletions .docker/nginx/conf/vhost_dev.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
user www-data;
worker_processes 4;
pid /run/nginx.pid;

events {
worker_connections 2048;
multi_accept on;
use epoll;
}

http {
server_tokens off;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 15;
types_hash_max_size 2048;
include /etc/nginx/mime.types;
default_type application/octet-stream;
access_log off;
error_log off;
gzip on;
gzip_disable "msie6";
open_file_cache max=100;

upstream php-upstream { server php:9000; }

server {
server_name linode.localhost
access_log /dev/stdout;
error_log /dev/stdout info;

root /app/web;
index app_dev.php;

location = /favicon.ico {
log_not_found off;
access_log off;
}

location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}

location / {
try_files $uri @rewriteapp;
}

location @rewriteapp {
rewrite ^(.*)$ /app_dev.php/$1 last;
}

location ~ ^/(app_dev|config)\.php(/|$) {
fastcgi_pass php-upstream;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param HTTPS off;
}
}
}
65 changes: 65 additions & 0 deletions .docker/nginx/conf/vhost_prod.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
user www-data;
worker_processes 4;
pid /run/nginx.pid;

events {
worker_connections 2048;
multi_accept on;
use epoll;
}

http {
server_tokens off;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 15;
types_hash_max_size 2048;
include /etc/nginx/mime.types;
default_type application/octet-stream;
access_log off;
error_log off;
gzip on;
gzip_disable "msie6";
open_file_cache max=100;

upstream php-upstream { server php:9000; }

server {
access_log /dev/stdout;
error_log /dev/stdout info;
gzip on;
gzip_comp_level 4;
gzip_types text/html text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;

root /app/web;
index app.php;

location = /favicon.ico {
log_not_found off;
access_log off;
}

location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}

location / {
try_files $uri @rewriteapp;
}

location @rewriteapp {
rewrite ^(.*)$ /app.php/$1 last;
}

location ~ ^/(app)\.php(/|$) {
fastcgi_pass php-upstream;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param HTTPS off;
}
}
}
66 changes: 14 additions & 52 deletions .docker/php/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,70 +1,32 @@
FROM php:5.6-fpm
FROM deployment.manpow.com:5000/heartland/php:7.1.0

MAINTAINER Mathew Peterson <mathewpeterson@me.com>

RUN usermod -u 1000 www-data

COPY bin/* /usr/local/bin/
RUN chmod +x -R /usr/local/bin/
MAINTAINER Michael Phillips <michael.phillips@manpow.com>

COPY conf/php.ini /usr/local/etc/php/conf.d/
COPY conf/pool.conf /usr/local/etc/php/

WORKDIR /app
COPY conf/pool.conf /usr/local/etc/php-fpm.d/www.conf
COPY conf/xdebug.ini /usr/local/etc/php/conf.d/docker-php-pecl-xdebug.ini
COPY conf/opcache.ini /usr/local/etc/php/conf.d/opcache.ini

RUN apt-install \
apt-utils \
less \
libssl-dev \
git \
zip \
libfreetype6-dev \
libjpeg62-turbo-dev \
libpng12-dev \
libxml2-dev \
libmcrypt-dev \
nodejs \
npm \
php5-ssh2 \
libssh2-1 \
libssh2-1-dev

RUN curl -o /tmp/node.tar.xz https://nodejs.org/dist/v6.9.4/node-v6.9.4-linux-x64.tar.xz
RUN cd /usr/local && tar --strip-components 1 -xJf /tmp/node.tar.xz

RUN ln -s /usr/bin/nodejs /usr/bin/node
RUN echo '{ "allow_root": true }' > /root/.bowerrc

RUN mkdir -p /tmp \
&& docker-php-ext-configure gd \
--with-freetype-dir=/usr/include/ \
--with-jpeg-dir=/usr/include/ \
&& docker-php-ext-install \
gd \
pdo \
pdo_mysql \
soap \
mcrypt \
pcntl \
&& docker-php-pecl-install zip memcached xdebug
RUN mkdir -p /usr/src/php/ext
RUN curl -o /tmp/ssh.tar.gz https://pecl.php.net/get/ssh2-1.0.tgz
RUN tar xf /tmp/ssh.tar.gz -C /usr/src/php/ext/
RUN rm /tmp/ssh.tar.gz

RUN docker-php-pecl-install xdebug ssh2-1.0

RUN curl -sS https://getcomposer.org/installer | php -- \
--install-dir=/usr/local/bin \
--filename=composer && \
echo "phar.readonly = off" > /usr/local/etc/php/conf.d/phar.ini

RUN version=$(php -r "echo PHP_MAJOR_VERSION.PHP_MINOR_VERSION;") \
&& curl -A "Docker" -o ./blackfire-probe.tar.gz -D - -L -s https://blackfire.io/api/v1/releases/probe/php/linux/amd64/$version \
&& mkdir ./blackfire \
&& tar zxpf ./blackfire-probe.tar.gz -C ./blackfire \
&& mv ./blackfire/blackfire-*.so $(php -r "echo ini_get('extension_dir');")/blackfire.so \
&& printf "extension=blackfire.so\nblackfire.agent_socket=tcp://blackfire:8707\n" > $PHP_INI_DIR/conf.d/blackfire.ini \
&& rm -r ./blackfire

RUN pecl install ssh2 channel://pecl.php.net/ssh2-0.13 \
&& cp /etc/php5/mods-available/ssh2.ini /usr/local/etc/php/conf.d/ssh2.ini

RUN curl -L -o ./phpunit.phar https://phar.phpunit.de/phpunit.phar \
&& chmod +x phpunit.phar \
&& mv phpunit.phar /usr/local/bin/phpunit

RUN npm install -g bower

ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
8 changes: 0 additions & 8 deletions .docker/php/bin/apt-install

This file was deleted.

6 changes: 0 additions & 6 deletions .docker/php/bin/apt-purge

This file was deleted.

36 changes: 0 additions & 36 deletions .docker/php/bin/docker-php-pecl-install

This file was deleted.

23 changes: 0 additions & 23 deletions .docker/php/bin/entrypoint.sh

This file was deleted.

1 change: 1 addition & 0 deletions .docker/php/conf/opcache.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
opcache.enable = 0
13 changes: 3 additions & 10 deletions .docker/php/conf/pool.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,16 @@
error_log = /proc/self/fd/2
daemonize = no

[api]
[www]
access.log = /proc/self/fd/2

user = www-data
group = www-data

chroot = /app

user = root
group = root
listen = [::]:9000

pm = dynamic
pm.max_children = 5
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 3

clear_env = no

; Ensure worker stdout and stderr are sent to the main error log.
catch_workers_output = yes
4 changes: 4 additions & 0 deletions .docker/php/conf/xdebug.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
zend_extension=xdebug.so
xdebug.remote_enable=on
xdebug.remote_handler=dbgp
xdebug.remote_port=9000
9 changes: 9 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
language: php
php:
- '7.1'
before_script:
- sudo apt-get install libssh2-1-dev
- printf "\n" | pecl install ssh2-1.0
- composer install -n
after_script:
- bash <(curl -s https://codecov.io/bash)
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[![Build Status](https://travis-ci.org/Nomad145/SymfonyLinodeProvisioner.svg?branch=master)](https://travis-ci.org/Nomad145/SymfonyLinodeProvisioner)
[![codecov](https://codecov.io/gh/Nomad145/SymfonyLinodeProvisioner/branch/master/graph/badge.svg)](https://codecov.io/gh/Nomad145/SymfonyLinodeProvisioner)

# SymfonyLinodeProvisioner
Creates and clones Linodes from an easy Web Interface.

Expand Down
Loading