2021-11-30 18:20:42 +08:00
|
|
|
# From https://github.com/docker-library/php/blob/master/8.0/buster/apache/Dockerfile
|
|
|
|
FROM php:8.0-apache-bullseye
|
|
|
|
|
|
|
|
EXPOSE 80
|
2021-12-03 19:14:39 +08:00
|
|
|
EXPOSE 8080
|
2021-11-30 18:20:42 +08:00
|
|
|
EXPOSE 8443
|
|
|
|
|
2021-12-03 19:14:39 +08:00
|
|
|
RUN mkdir -p /mnt/docker-aio-config/;
|
2021-11-30 18:20:42 +08:00
|
|
|
|
|
|
|
VOLUME /mnt/docker-aio-config/
|
|
|
|
|
2021-12-03 19:14:39 +08:00
|
|
|
RUN mkdir -p /var/www/docker-aio;
|
2021-11-30 18:20:42 +08:00
|
|
|
|
|
|
|
WORKDIR /var/www/docker-aio
|
|
|
|
|
|
|
|
RUN apt-get update; \
|
|
|
|
apt-get install -y --no-install-recommends \
|
|
|
|
git \
|
|
|
|
supervisor \
|
|
|
|
openssl \
|
|
|
|
sudo \
|
|
|
|
; \
|
|
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
|
|
|
|
RUN curl "https://caddyserver.com/api/download?os=linux&arch=amd64" -o "/usr/bin/caddy" \
|
2021-12-03 19:14:39 +08:00
|
|
|
&& chmod +x /usr/bin/caddy \
|
2021-11-30 18:20:42 +08:00
|
|
|
&& /usr/bin/caddy version
|
|
|
|
|
|
|
|
RUN cd /var/www/docker-aio; \
|
2021-11-30 19:24:57 +08:00
|
|
|
git clone https://github.com/nextcloud/all-in-one.git .; \
|
2021-12-03 20:13:51 +08:00
|
|
|
chmod 770 -R ./; \
|
|
|
|
chown www-data:www-data -R ./
|
2021-11-30 18:20:42 +08:00
|
|
|
|
|
|
|
RUN mkdir -p /etc/apache2/certs && \
|
|
|
|
cd /etc/apache2/certs && \
|
2021-12-03 19:14:39 +08:00
|
|
|
openssl req -new -newkey rsa:4096 -days 3650 -nodes -x509 -subj "/C=DE/ST=BE/L=Local/O=Dev/CN=nextcloud.local" -keyout ./ssl.key -out ./ssl.crt;
|
2021-11-30 18:20:42 +08:00
|
|
|
|
|
|
|
COPY mastercontainer.conf /etc/apache2/sites-available/
|
|
|
|
|
|
|
|
RUN a2enmod rewrite \
|
|
|
|
headers \
|
|
|
|
env \
|
|
|
|
mime \
|
|
|
|
dir \
|
|
|
|
authz_core \
|
|
|
|
proxy \
|
|
|
|
proxy_http \
|
|
|
|
ssl
|
|
|
|
|
|
|
|
RUN rm /etc/apache2/ports.conf; \
|
|
|
|
sed -s -i -e "s/Include ports.conf//" /etc/apache2/apache2.conf; \
|
|
|
|
sed -i "/^Listen /d" /etc/apache2/apache2.conf
|
|
|
|
|
|
|
|
RUN a2dissite 000-default && \
|
|
|
|
a2dissite default-ssl && \
|
|
|
|
a2ensite mastercontainer.conf && \
|
|
|
|
service apache2 restart
|
|
|
|
|
|
|
|
RUN mkdir /var/log/supervisord; \
|
2021-12-03 19:14:39 +08:00
|
|
|
mkdir /var/run/supervisord;
|
2021-11-30 18:20:42 +08:00
|
|
|
|
2021-12-03 19:14:39 +08:00
|
|
|
RUN mkdir -p /usr/src/php/ext/apcu && \
|
|
|
|
curl -fsSL https://pecl.php.net/get/apcu | tar xvz -C "/usr/src/php/ext/apcu" --strip 1 && \
|
|
|
|
docker-php-ext-install apcu
|
2021-11-30 18:20:42 +08:00
|
|
|
|
|
|
|
COPY Caddyfile /
|
|
|
|
COPY start.sh /usr/bin/
|
|
|
|
COPY cron.sh /
|
|
|
|
COPY supervisord.conf /
|
|
|
|
RUN chmod +x /usr/bin/start.sh; \
|
|
|
|
chmod +x /cron.sh
|
|
|
|
|
2021-12-03 19:14:39 +08:00
|
|
|
USER root
|
2021-11-30 18:20:42 +08:00
|
|
|
|
|
|
|
ENTRYPOINT ["start.sh"]
|
|
|
|
CMD ["/usr/bin/supervisord", "-c", "/supervisord.conf"]
|