Dockerfile Added! #16

Merged
emilyd merged 3 commits from :main into docker 2022-11-27 11:13:34 +00:00
3 changed files with 57 additions and 0 deletions
Showing only changes of commit a098c78841 - Show all commits

26
Caddyfile Normal file
View File

@ -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

23
Dockerfile Normal file
View File

@ -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"]

View File

@ -45,3 +45,11 @@ EXIT;
8. Copy templates/config.def.php to templates/config.php. Change the placeholders. 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. * 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. 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```