moodblog/Dockerfile

24 lines
1.0 KiB
Docker
Raw Normal View History

2022-11-26 20:28:25 +00:00
# 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"]