FEATURE: Autoconfigure defaults
This commit is contained in:
parent
70ebbf7d68
commit
7012ed8ab2
19
Dockerfile
19
Dockerfile
@ -25,10 +25,7 @@ RUN apt install zip unzip git gnupg2 ca-certificates lsb-release apt-transport-h
|
|||||||
# Installing and configuring nginx
|
# Installing and configuring nginx
|
||||||
RUN apt install nginx -y --no-install-recommends \
|
RUN apt install nginx -y --no-install-recommends \
|
||||||
&& apt auto-remove -y \
|
&& apt auto-remove -y \
|
||||||
&& apt clean -y \
|
&& apt clean -y
|
||||||
&& rm -v /etc/nginx/sites-enabled/default /var/www/html/index.nginx-debian.html
|
|
||||||
COPY buildfiles/nextcloud_nginx.conf /etc/nginx/sites-available/
|
|
||||||
RUN ln -s /etc/nginx/sites-available/nextcloud_nginx.conf /etc/nginx/sites-enabled/
|
|
||||||
|
|
||||||
# Installing redis
|
# Installing redis
|
||||||
RUN apt install redis -y --no-install-recommends \
|
RUN apt install redis -y --no-install-recommends \
|
||||||
@ -64,10 +61,20 @@ RUN bash -c 'apt install -y php${PHPVERSION}-{apcu,memcached,redis} --no-install
|
|||||||
RUN bash -c 'apt install -y php${PHPVERSION}-imagick imagemagick ffmpeg libreoffice --no-install-recommends'
|
RUN bash -c 'apt install -y php${PHPVERSION}-imagick imagemagick ffmpeg libreoffice --no-install-recommends'
|
||||||
|
|
||||||
#Installing Optional cli enhancement PHP Modules
|
#Installing Optional cli enhancement PHP Modules
|
||||||
RUN bash -c 'apt install -y php${PHPVERSION}-{pcntl} --no-install-recommends'
|
#RUN bash -c 'apt install -y php${PHPVERSION}-pcntl --no-install-recommends'
|
||||||
|
|
||||||
|
|
||||||
|
# Delete default stuff
|
||||||
|
#nginx
|
||||||
|
RUN rm -v /etc/nginx/sites-enabled/default /var/www/html/index.nginx-debian.html
|
||||||
|
|
||||||
|
|
||||||
|
#Autoconfig defaults
|
||||||
|
RUN mkdir /root/default_configs
|
||||||
|
COPY buildfiles/auto_config.sh .
|
||||||
|
COPY buildfiles/nextcloud_nginx.conf /root/default_configs/
|
||||||
|
|
||||||
CMD ["bash"]
|
#autostart files
|
||||||
|
COPY buildfiles/start_services.sh .
|
||||||
|
RUN chmod +x start_services.sh
|
||||||
|
CMD ["./start_services.sh"]
|
||||||
|
9
buildfiles/auto_config.sh
Normal file
9
buildfiles/auto_config.sh
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
if ![ -f /etc/nginx/sites-enabled/nextcloud_nginx.conf]
|
||||||
|
then
|
||||||
|
cp -v /root/default_configs/nextcloud_nginx.conf /etc/nginx/sites-available/
|
||||||
|
ln -sv /etc/nginx/sites-available/nextcloud_nginx.conf /etc/nginx/sites-enabled/
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
17
buildfiles/start_services.sh
Normal file
17
buildfiles/start_services.sh
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
#Default auto configs
|
||||||
|
/root/auto_config.sh
|
||||||
|
|
||||||
|
#Start Php-fpm
|
||||||
|
/usr/sbin/php-fpm7.2 --nodaemonize --fpm-config /etc/php/7.2/fpm/php-fpm.conf &
|
||||||
|
|
||||||
|
#Start Nginx
|
||||||
|
/usr/sbin/nginx -g 'daemon off; master_process on;' &
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# Wait for any process to exit
|
||||||
|
wait -n
|
||||||
|
# Exit with status of process that exited first
|
||||||
|
exit $?
|
@ -4,5 +4,7 @@ services:
|
|||||||
app:
|
app:
|
||||||
build: .
|
build: .
|
||||||
image: git.shihaam.me/dockerfiles/nextcloud
|
image: git.shihaam.me/dockerfiles/nextcloud
|
||||||
|
volumes:
|
||||||
|
- ./configs/etc/nginx/sites-enabled:/etc/nginx/sites-enabled
|
||||||
ports:
|
ports:
|
||||||
- 8000:80
|
- 8000:80
|
||||||
|
Loading…
x
Reference in New Issue
Block a user