NextCloud / Dockerfile
Artples's picture
Update Dockerfile
3d4a502 verified
FROM nextcloud:apache
ENV APACHE_PORT=7860
RUN echo "ServerName localhost" >> /etc/apache2/apache2.conf \
&& sed -i "s/Listen 80/Listen ${APACHE_PORT}/" /etc/apache2/ports.conf \
&& sed -i "s/:80/:${APACHE_PORT}/" /etc/apache2/sites-available/000-default.conf
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
mariadb-server mariadb-client \
redis-server \
cron \
ffmpeg \
dos2unix \
&& rm -rf /var/lib/apt/lists/*
RUN { \
echo "[mysqld]"; \
echo "bind-address=127.0.0.1"; \
echo "skip-name-resolve"; \
echo "character-set-server=utf8mb4"; \
echo "collation-server=utf8mb4_general_ci"; \
echo "innodb_file_per_table=1"; \
} > /etc/mysql/mariadb.conf.d/99-hf-space.cnf
RUN printf "*/5 * * * * www-data php -f /var/www/html/cron.php >/dev/null 2>&1\n" > /etc/cron.d/nextcloud \
&& chmod 0644 /etc/cron.d/nextcloud
RUN mkdir -p /docker-entrypoint-hooks.d/post-installation
COPY post-installation/10-tune.sh /docker-entrypoint-hooks.d/post-installation/10-tune.sh
RUN dos2unix /docker-entrypoint-hooks.d/post-installation/10-tune.sh \
&& chmod +x /docker-entrypoint-hooks.d/post-installation/10-tune.sh
COPY start.sh /start.sh
RUN dos2unix /start.sh && chmod +x /start.sh
EXPOSE 7860
ENTRYPOINT ["/start.sh"]
CMD ["apache2-foreground"]