diff --git a/Caddyfile b/Caddyfile new file mode 100644 index 0000000..3234d43 --- /dev/null +++ b/Caddyfile @@ -0,0 +1,26 @@ +# The Caddyfile is an easy way to configure your Caddy web server. +# +# Unless the file starts with a global options block, the first +# uncommented line is always the address of your site. +# +# To use your own domain name (with automatic HTTPS), first make +# sure your domain's A/AAAA DNS records are properly pointed to +# this machine's public IP, then replace ":80" below with your +# domain name. + +:80 { +# Set this path to your site's directory. +root * /usr/share/caddy + +# Disable the static file server. +# file_server + +# Another common task is to set up a reverse proxy: +# reverse_proxy localhost:8080 + +# Serve a PHP site through php-fpm: +php_fastcgi localhost:9000 +} + +# Refer to the Caddy docs for more information: +# https://caddyserver.com/docs/caddyfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..16e6688 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,23 @@ +# syntax=docker/dockerfile:1 +# Define Our Base Distro (Alpine) +FROM alpine:3.16 +# installing dependencies +RUN apk add --no-cache php mariadb php-mysqli bind-tools openssh-client git tar curl libcap ca-certificates mailcap php-fpm +# Installing Caddy (https server, feel free to replace with your favorite webserver) +RUN curl --silent --show-error --fail --location --header "Accept: application/tar+gzip, application/x-gzip, application/octet-stream" -o - \ +"https://github.com/caddyserver/caddy/releases/download/v2.4.6/caddy_2.4.6_linux_amd64.tar.gz" \ +| tar --no-same-owner -C /usr/bin/ -xz caddy && \ +chmod 0755 /usr/bin/caddy && \ +addgroup -S caddy && \ +adduser -D -S -s /sbin/nologin -G caddy caddy && \ +setcap cap_net_bind_service=+ep `readlink -f /usr/bin/caddy` && \ +/usr/bin/caddy version +# Setting up the directories +VOLUME /srv +RUN chown -R caddy:caddy /srv +COPY Caddyfile /etc/Caddyfile +COPY ./ /srv/ +# Getting Omline! +EXPOSE 80 443 2015 +WORKDIR /srv +CMD ["/usr/bin/caddy", "run", "--config", "/etc/Caddyfile", "--adapter", "caddyfile"] \ No newline at end of file diff --git a/README.md b/README.md index c8b3ce5..159193a 100644 --- a/README.md +++ b/README.md @@ -45,3 +45,11 @@ EXIT; 8. Copy templates/config.def.php to templates/config.php. Change the placeholders. * You really only need to change $url and $root to get a working installation, however, you really should change everything after $password. 9. Sever your leg please. It's the greatest day. + + +## Using the Dockerfile + +1. Git clone this repo +2. Make sure you have Docker Installed +2. Configure both moodblog configs and Caddyfile +3. Go! ```docker build .```