From a2f7357f012830bdcdc40cc86e34215dc51fbc08 Mon Sep 17 00:00:00 2001 From: Carvallegro Date: Mon, 4 Dec 2017 15:56:48 +1100 Subject: [PATCH] Added a Docker containerisation --- Dockerfile | 15 +++++++++++++++ README.md | 18 ++++++++++++++++++ docker-compose.yaml | 7 +++++++ 3 files changed, 40 insertions(+) create mode 100644 Dockerfile create mode 100644 docker-compose.yaml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..9cdcb50d5 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,15 @@ +FROM php:apache +COPY . /var/www/html/ + +# Authorize these folders to be edited +RUN chmod -R 777 /var/www/html/storage +RUN chmod -R 777 /var/www/html/bootstrap/cache + +# Install ZIP extension +RUN apt-get update && \ + apt-get install -y --no-install-recommends zip libzip-dev +RUN pecl install zip && \ + docker-php-ext-enable zip + +# Allow rewrite +RUN a2enmod rewrite diff --git a/README.md b/README.md index bcce76a05..c20733b23 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,24 @@ Akaunting uses [Laravel](http://laravel.com), the best existing PHP framework, a * Run the following commands separately: `composer install` , `composer dump-autoload` * Finally, launch the [installer](https://akaunting.com/docs/installation) +## Docker + +It is possible to containerise Akounting using the [`docker-compose`](./docker-compose.yaml) file. Here are a few commands: + +``` +# Make sure you the dependencies are installed +composer install && composer dump-autoload + +# Build the app +docker-compose build + +# Run the app +docker-compose up + +# Access the container +docker exec -it CONTAINER_ID /bin/sh +``` + ## Contributing Fork the repository, make the code changes then submit a pull request. diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 000000000..11af63974 --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,7 @@ +version: '3' +services: + web: + image: akaunting + build: . + ports: + - "80:80" \ No newline at end of file