diff --git a/Dockerfile b/Dockerfile index 1562590ee..1e0f6ebdc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,6 +4,15 @@ RUN apt-get update && apt-get install -y zip libzip-dev libpng-dev \ && docker-php-ext-install pdo_mysql gd zip \ && rm -rf /var/lib/apt/lists/* +# Composer installation. +COPY --from=composer:latest /usr/bin/composer /usr/bin/composer + +# https://getcomposer.org/doc/03-cli.md#composer-allow-superuser +ENV COMPOSER_ALLOW_SUPERUSER=1 +RUN composer global require hirak/prestissimo --prefer-dist --no-progress --no-suggest --classmap-authoritative \ + && composer clear-cache +ENV PATH="${PATH}:/root/.composer/vendor/bin" + COPY . /var/www/html/ # Authorize these folders to be edited diff --git a/README.md b/README.md index 67b57c911..72790b468 100644 --- a/README.md +++ b/README.md @@ -31,24 +31,24 @@ Akaunting uses [Laravel](http://laravel.com), the best existing PHP framework, a ## Docker -It is possible to containerise Akaunting using the [`docker-compose`](docker/docker-compose.build.yaml) file. Here are a few commands: +It is possible to containerise Akaunting using the [`docker-compose`](docker-compose.yaml) file. Here are a few commands: ``` +# Build & Run the app +docker-compose up -d + # Make sure you the dependencies are installed -composer install +docker-compose exec web composer install -# Build the app -docker-compose -f docker/docker-compose.build.yaml build - -# Run the app -docker-compose up +# Stream logs +docker-compose logs -f web # Access the container -docker exec -it CONTAINER_ID /bin/sh -``` +docker-compose exec web /bin/sh -#### Examples -In the `docker/` folder you'll find some example file to run the image with several databases. +# Stop & Delete everything +docker-compose down -v +``` ## Contributing diff --git a/docker/docker-compose.mysql.yaml b/docker-compose.yml similarity index 68% rename from docker/docker-compose.mysql.yaml rename to docker-compose.yml index f330cd829..8a5899740 100644 --- a/docker/docker-compose.mysql.yaml +++ b/docker-compose.yml @@ -1,7 +1,7 @@ version: '3' services: mysql: - image: mysql + image: mysql:5 ports: - 3306:3306 environment: @@ -11,12 +11,12 @@ services: MYSQL_PASSWORD: akaunting_password web: image: akaunting - ## Uncomment if you wish to use this configuration as development environment. - # volumes: - # - ../:/var/www/html + build: ./ + volumes: + - ./:/var/www/html ports: - 8080:80 environment: APP_DEBUG: "true" links: - - mysql \ No newline at end of file + - mysql diff --git a/docker/docker-compose.build.yaml b/docker/docker-compose.build.yaml deleted file mode 100644 index f24d8e392..000000000 --- a/docker/docker-compose.build.yaml +++ /dev/null @@ -1,7 +0,0 @@ -version: '3' -services: - web: - image: akaunting - build: ../ - ports: - - "80:80" \ No newline at end of file