diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..571a4eb --- /dev/null +++ b/.drone.yml @@ -0,0 +1,21 @@ +# Declare a pipeline +pipeline: + # Declare pipeline step + composer-install: + # Use image for step + image: fpfis/php71-build + # Run commands from this image + commands: + - composer install --ansi + + # Declare another step + lint-code: + image: fpfis/php71-build + commands: + - php -l index.php + + run-code: + image: fpfis/php71-build + commands: + - php index.php + diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..1b1724d --- /dev/null +++ b/Dockerfile @@ -0,0 +1,18 @@ + +# Base image : +FROM fpfis/php56-build + +# Create a folder for my app in the container +RUN mkdir /app + +# Make the image work in this directory by default +WORKDIR /app + +# Push my local files to the image +ADD . /app + +# Run composer install to get my app ready +RUN composer install + +# Specify which command to run when my container starts +#ENTRYPOINT [ "php", "/app/hello.php" ] diff --git a/composer.json b/composer.json index e7ac977..00e7dd8 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { "require": { - "symfony/yaml" : "*", + "symfony/yaml" : "*" } } diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..9a74da7 --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,25 @@ +version: '2' +services: + + # Define a PHP webserver + php-webserver: + # Use a PHP image with apache + #image: fpfis/php56-dev + image: myapp + #working_dir: /app + # Define settings + environment: + - XDEBUG=true + - DOCUMENT_ROOT=/app + # Mount a local volume in the container + volumes: + - ./:/app/build + # Share the container port with the host + ports: + - 8080:8080 + + # Define a mysql service + mysql: + image: fpfis/mysql56 + + diff --git a/index.php b/index.php index 03efc33..60912ca 100644 --- a/index.php +++ b/index.php @@ -7,7 +7,7 @@ $array = array( 'foo' => 'bar', - 'bar' => array('foo' => 'bar', 'bar' => 'baz' => 'test'), + 'bar' => array('foo' => 'bar', 'bar' => 'baz', 'test' => 'test') ); echo Yaml::dump($array);