feat: add Caddy as a web server

This commit is contained in:
Oliver Davies 2023-02-14 20:14:43 +00:00
parent 1d7f796538
commit eb29d11134
5 changed files with 53 additions and 3 deletions

View file

@ -53,6 +53,17 @@ RUN {% for command in dockerfile.stages.test.commands -%}
{% endfor %}
{% endif %}
{% if web.type == "caddy" %}
################################################################################
FROM caddy:2 as web
WORKDIR /app
COPY tools/docker/images/web/root /
{% endif %}
{% if web.type == "nginx" %}
################################################################################
@ -62,5 +73,5 @@ EXPOSE 8080
WORKDIR /app
COPY tools/docker/images/nginx/root /
COPY tools/docker/images/web/root /
{% endif %}

View file

@ -0,0 +1,4 @@
:80
root * /app/docroot
file_server
php_fastcgi php:9000

View file

@ -0,0 +1,20 @@
server {
server_name _;
root /app/docroot;
location / {
try_files $uri /index.php?$query_string;
}
location ~ \.php(/|$) {
fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
try_files $fastcgi_script_name =404;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param QUERY_STRING $query_string;
fastcgi_intercept_errors on;
fastcgi_pass php:9000;
}
}