From 8ea48bcaf3b6ab3c8fd1cf16fb5a09467697f865 Mon Sep 17 00:00:00 2001 From: Kacper Donat Date: Fri, 18 Dec 2020 15:19:58 +0100 Subject: [PATCH] Add simple README and LICENSE files --- LICENSE.md | 0 README.md | 0 api/bin/docker-init.sh | 5 +++++ api/config/services.yaml | 3 +-- api/fpm.Dockerfile | 5 +++-- api/rr.Dockerfile | 5 +++-- api/src/Service/Proxy/FileLocator.php | 13 ++++++++++--- 7 files changed, 22 insertions(+), 9 deletions(-) create mode 100644 LICENSE.md create mode 100644 README.md create mode 100755 api/bin/docker-init.sh diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..e69de29 diff --git a/README.md b/README.md new file mode 100644 index 0000000..e69de29 diff --git a/api/bin/docker-init.sh b/api/bin/docker-init.sh new file mode 100755 index 0000000..0799aea --- /dev/null +++ b/api/bin/docker-init.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +./bin/console doctrine:migrations:migrate --no-interaction + +exec "$@" diff --git a/api/config/services.yaml b/api/config/services.yaml index 7b8e853..aeb122d 100644 --- a/api/config/services.yaml +++ b/api/config/services.yaml @@ -53,7 +53,7 @@ services: #proxy configuration proxy.locator: - class: 'ProxyManager\FileLocator\FileLocator' + class: 'App\Service\Proxy\FileLocator' arguments: ['%kernel.cache_dir%/proxy'] proxy.strategy: @@ -68,7 +68,6 @@ services: ProxyManager\Configuration: '@proxy.config' - # converter App\Service\AggregateConverter: arguments: diff --git a/api/fpm.Dockerfile b/api/fpm.Dockerfile index d3b9fe2..f5955a5 100644 --- a/api/fpm.Dockerfile +++ b/api/fpm.Dockerfile @@ -1,7 +1,8 @@ FROM php:7.4-fpm-alpine ENV APP_ENV=prod -ENV DATABASE_URL="sqlite:///var/db/app.db" +ENV DATABASE_URL="sqlite:////var/db/app.db" +ENV PATH=$PATH:/usr/src/app/bin RUN apk add --no-cache autoconf openssl-dev g++ make pcre-dev icu-dev zlib-dev libzip-dev git && \ docker-php-ext-install bcmath intl opcache zip sockets && \ @@ -21,4 +22,4 @@ RUN ln -snf /usr/share/zoneinfo/Europe/Warsaw /etc/localtime && WORKDIR /var/www -EXPOSE 9001 +CMD ["./bin/docker-init.sh", "php-fpm"] diff --git a/api/rr.Dockerfile b/api/rr.Dockerfile index 59b914f..56fa7e2 100644 --- a/api/rr.Dockerfile +++ b/api/rr.Dockerfile @@ -1,7 +1,8 @@ FROM php:7.4-alpine ENV APP_ENV=prod -ENV DATABASE_URL="sqlite:///var/db/app.db" +ENV DATABASE_URL="sqlite:////var/db/app.db" +ENV PATH=$PATH:/usr/src/app/bin RUN apk add --no-cache autoconf openssl-dev g++ make pcre-dev icu-dev zlib-dev libzip-dev git && \ docker-php-ext-install bcmath intl opcache zip sockets && \ @@ -21,4 +22,4 @@ RUN composer dump-autoload --optimize && \ EXPOSE 8080 -CMD ["rr", "serve"] +CMD ["./bin/docker-init.sh", "rr", "serve"] diff --git a/api/src/Service/Proxy/FileLocator.php b/api/src/Service/Proxy/FileLocator.php index 4abee52..0d34263 100644 --- a/api/src/Service/Proxy/FileLocator.php +++ b/api/src/Service/Proxy/FileLocator.php @@ -1,10 +1,17 @@