From a098c78841de28746147c9b7406a2877110319a2 Mon Sep 17 00:00:00 2001 From: Damaj301damaj-lol Date: Sat, 26 Nov 2022 20:28:25 +0000 Subject: [PATCH 1/3] Upload files to '' --- Caddyfile | 26 ++++++++++++++++++++++++++ Dockerfile | 23 +++++++++++++++++++++++ README.md | 8 ++++++++ 3 files changed, 57 insertions(+) create mode 100644 Caddyfile create mode 100644 Dockerfile 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..77d5830 --- /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"] diff --git a/README.md b/README.md index c8b3ce5..a863531 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``` From 0820a16789f89afa3e25addf84fa835aed0bc328 Mon Sep 17 00:00:00 2001 From: Damaj301damaj-lol Date: Sat, 26 Nov 2022 20:52:17 +0000 Subject: [PATCH 2/3] Fixed error --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 77d5830..16e6688 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,8 +16,8 @@ setcap cap_net_bind_service=+ep `readlink -f /usr/bin/caddy` && \ VOLUME /srv RUN chown -R caddy:caddy /srv COPY Caddyfile /etc/Caddyfile -COPY * /srv/* +COPY ./ /srv/ # Getting Omline! EXPOSE 80 443 2015 WORKDIR /srv -CMD ["/usr/bin/caddy", "run", "--config", "/etc/Caddyfile", "--adapter", "caddyfile"] +CMD ["/usr/bin/caddy", "run", "--config", "/etc/Caddyfile", "--adapter", "caddyfile"] \ No newline at end of file From f87546b863edbbf4d460a64d0dd65b2b9d99c060 Mon Sep 17 00:00:00 2001 From: Damaj301damaj-lol Date: Sat, 26 Nov 2022 20:53:00 +0000 Subject: [PATCH 3/3] Fixed mistake --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a863531..159193a 100644 --- a/README.md +++ b/README.md @@ -52,4 +52,4 @@ EXIT; 1. Git clone this repo 2. Make sure you have Docker Installed 2. Configure both moodblog configs and Caddyfile -3. Go! ```docker build``` +3. Go! ```docker build .```