From 3463ad03b4e55071fd4d98f1b41218056da7c5a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristoffer=20H=C3=B6gberg?= Date: Thu, 24 Jan 2019 09:33:45 +0100 Subject: [PATCH] Add Dockerfile and docker-compose --- Dockerfile | 10 ++++++++++ README.md | 16 ++++++++++++++++ docker-compose.yml | 10 ++++++++++ 3 files changed, 36 insertions(+) create mode 100644 Dockerfile create mode 100644 docker-compose.yml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..9c08183 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,10 @@ +FROM php:7.3-alpine + +RUN curl -o /usr/local/bin/composer https://getcomposer.org/composer.phar \ + && chmod +x /usr/local/bin/composer + +COPY . /app + +WORKDIR /app + +RUN composer install --no-dev \ No newline at end of file diff --git a/README.md b/README.md index 1cc350f..7f168f3 100644 --- a/README.md +++ b/README.md @@ -21,11 +21,27 @@ The skeleton can then be executed with: ./app ``` +### Running with docker + +Build the app with: +```bash +docker-compose build +``` + +And run the app with docker with this command: +```bash +docker-compose run console ./app +``` + +### Tests + Tests can be run with: ```bash composer test ``` +### Continue building + Go ahead and: * Edit/replace command in src/Commad/ExampleCommand * Add more commands in src/Command diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..34b8cef --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,10 @@ +version: "3" + +services: + console: + image: hmazter/console-skeleton:latest + build: + context: . + dockerfile: Dockerfile + volumes: + - ".:/app" \ No newline at end of file