Browse Source

PHP + Caddy initial commit

master
sipp11 6 years ago
commit
9b76fdf973
  1. 10
      docker-compose.yml
  2. 13
      docker/Caddyfile
  3. 21
      docker/Dockerfile
  4. 3
      public/index.php

10
docker-compose.yml

@ -0,0 +1,10 @@
version: '3'
services:
app:
build:
context: .
dockerfile: docker/Dockerfile
ports:
- 8080:2015
volumes:
- .:/srv/app

13
docker/Caddyfile

@ -0,0 +1,13 @@
0.0.0.0
root /srv/app/public
gzip
fastcgi / 127.0.0.1:9000 php
rewrite {
regexp .*
ext /
to /index.php?{query}
}
log stdout
errors stdout
on startup php-fpm7 # php variant only

21
docker/Dockerfile

@ -0,0 +1,21 @@
FROM abiosoft/caddy:php-no-stats
LABEL maintainer="Sippakorn K <sipp11@zzyzx.co>"
# Install application dependencies
# RUN curl --silent --show-error --fail --location \
# --header "Accept: application/tar+gzip, application/x-gzip, application/octet-stream" -o - \
# "https://caddyserver.com/download/linux/amd64?plugins=http.expires,http.realip&license=personal" \
# | tar --no-same-owner -C /usr/bin/ -xz caddy \
# && chmod 0755 /usr/bin/caddy \
# && /usr/bin/caddy -version \
# && docker-php-ext-install mbstring pdo pdo_mysql
COPY . /srv/app
COPY docker/Caddyfile /etc/Caddyfile
WORKDIR /srv
# RUN chown -R www-data:www-data /srv/app
ENTRYPOINT ["/bin/parent", "caddy"]
CMD ["--conf", "/etc/Caddyfile", "--log", "stdout"]

3
public/index.php

@ -0,0 +1,3 @@
<?php
phpinfo();
?>
Loading…
Cancel
Save