From f476a9f1c0cfc75d60bd4b261a36222a27d10fde Mon Sep 17 00:00:00 2001 From: Matthieu Poletti Date: Sun, 22 Nov 2020 17:55:38 +0200 Subject: [PATCH] add debian version --- .idea/.gitignore | 2 ++ .idea/composerJson.xml | 10 ++++++++++ .idea/docker-caddy-php.iml | 8 ++++++++ .idea/misc.xml | 6 ++++++ .idea/modules.xml | 8 ++++++++ .idea/vcs.xml | 6 ++++++ caddy2/php7.4-debian/Caddyfile | 6 ++++++ caddy2/php7.4-debian/Dockerfile | 34 +++++++++++++++++++++++++++++++++ 8 files changed, 80 insertions(+) create mode 100644 .idea/.gitignore create mode 100644 .idea/composerJson.xml create mode 100644 .idea/docker-caddy-php.iml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml create mode 100644 caddy2/php7.4-debian/Caddyfile create mode 100644 caddy2/php7.4-debian/Dockerfile diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..e7e9d11 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,2 @@ +# Default ignored files +/workspace.xml diff --git a/.idea/composerJson.xml b/.idea/composerJson.xml new file mode 100644 index 0000000..1b07430 --- /dev/null +++ b/.idea/composerJson.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/.idea/docker-caddy-php.iml b/.idea/docker-caddy-php.iml new file mode 100644 index 0000000..80e5c50 --- /dev/null +++ b/.idea/docker-caddy-php.iml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..28a804d --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..f159a35 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/caddy2/php7.4-debian/Caddyfile b/caddy2/php7.4-debian/Caddyfile new file mode 100644 index 0000000..7397a25 --- /dev/null +++ b/caddy2/php7.4-debian/Caddyfile @@ -0,0 +1,6 @@ +:8080 + +root * /var/www/html/public +encode gzip +php_fastcgi 127.0.0.1:9000 +file_server diff --git a/caddy2/php7.4-debian/Dockerfile b/caddy2/php7.4-debian/Dockerfile new file mode 100644 index 0000000..36bdf62 --- /dev/null +++ b/caddy2/php7.4-debian/Dockerfile @@ -0,0 +1,34 @@ +FROM caddy:2.2.1 as caddy + +FROM php:7.4-fpm + +RUN apt-get update +RUN apt-get install -y autoconf zlib1g-dev +RUN pecl install grpc +RUN docker-php-ext-enable grpc + +COPY --from=caddy /config /config +COPY --from=caddy /data /data +COPY --from=caddy /usr/bin/caddy /usr/bin/caddy +COPY Caddyfile /etc/caddy/ + +COPY php-fpm /usr/local/etc/php-fpm.d +RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini" + +COPY php-caddy-entrypoint /usr/local/bin/ +RUN chmod +x /usr/local/bin/php-caddy-entrypoint +RUN curl --tlsv1 -v -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer + +#Install node +RUN curl -sL https://deb.nodesource.com/setup_14.x | bash - +RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - +RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list +RUN apt-get install -y nodejs +RUN apt update && apt install -y --no-install-recommends yarn + +EXPOSE 8080 + + +ENTRYPOINT [ "php-caddy-entrypoint" ] + +CMD ["caddy", "run", "--config", "/etc/caddy/Caddyfile", "--adapter", "caddyfile"] \ No newline at end of file