Improve the installation procedure
This commit is contained in:
parent
dd6559a4aa
commit
3e4e0c8358
4 changed files with 50 additions and 17 deletions
9
.docker/nuth.sh
Normal file
9
.docker/nuth.sh
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
#!/bin/bash
|
||||||
|
until nc -z db 3306
|
||||||
|
do
|
||||||
|
>&2 echo "mysql is unavailable - waiting"
|
||||||
|
sleep 1
|
||||||
|
done
|
||||||
|
|
||||||
|
sudo -u www-data ../app/scripts/install.sh
|
||||||
|
apache2-foreground
|
14
Dockerfile
14
Dockerfile
|
@ -1,4 +1,5 @@
|
||||||
FROM php:7.1.27-apache
|
FROM php:7.2.17-apache
|
||||||
|
COPY .docker/nuth.sh /usr/local/bin/nuth-start
|
||||||
RUN chown -R www-data:www-data /var/www
|
RUN chown -R www-data:www-data /var/www
|
||||||
|
|
||||||
RUN apt update -y
|
RUN apt update -y
|
||||||
|
@ -8,6 +9,8 @@ RUN apt install --no-install-recommends -y \
|
||||||
libtidy-dev \
|
libtidy-dev \
|
||||||
libzip-dev \
|
libzip-dev \
|
||||||
mysql-client \
|
mysql-client \
|
||||||
|
netcat \
|
||||||
|
rsync \
|
||||||
sudo \
|
sudo \
|
||||||
unzip \
|
unzip \
|
||||||
zip
|
zip
|
||||||
|
@ -36,10 +39,13 @@ RUN mv composer.phar /usr/local/bin/composer
|
||||||
COPY --chown=www-data:www-data ./composer.* ./
|
COPY --chown=www-data:www-data ./composer.* ./
|
||||||
RUN sudo -u www-data mkdir public
|
RUN sudo -u www-data mkdir public
|
||||||
RUN sudo -u www-data composer install
|
RUN sudo -u www-data composer install
|
||||||
|
RUN ./vendor/bin/sake installsake
|
||||||
COPY --chown=www-data:www-data .docker/.env .env
|
|
||||||
|
|
||||||
COPY .docker/xdebug.ini $PHP_INI_DIR/conf.d/
|
COPY .docker/xdebug.ini $PHP_INI_DIR/conf.d/
|
||||||
COPY .docker/date.ini $PHP_INI_DIR/conf.d/
|
COPY .docker/date.ini $PHP_INI_DIR/conf.d/
|
||||||
COPY --chown=www-data:www-data ./ ./
|
|
||||||
|
COPY --chown=www-data:www-data .docker/.env .env
|
||||||
|
COPY --chown=www-data:www-data ./ ../app
|
||||||
RUN sudo -u www-data composer vendor-expose
|
RUN sudo -u www-data composer vendor-expose
|
||||||
|
|
||||||
|
CMD [ "nuth-start" ]
|
|
@ -11,6 +11,8 @@ services:
|
||||||
- nuth
|
- nuth
|
||||||
ports:
|
ports:
|
||||||
- 8000:80
|
- 8000:80
|
||||||
|
depends_on:
|
||||||
|
- db
|
||||||
db:
|
db:
|
||||||
image: mysql:5
|
image: mysql:5
|
||||||
networks:
|
networks:
|
||||||
|
|
|
@ -1,24 +1,40 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
cd $(dirname $0)
|
destinationDir=$(pwd)
|
||||||
cd ..
|
|
||||||
tempDir=$(mktemp -d)
|
tempDir=$(mktemp -d)
|
||||||
sourceDir="."
|
sourceDir="."
|
||||||
|
|
||||||
find $sourceDir \
|
cd $(dirname $0)
|
||||||
|
cd ..
|
||||||
|
|
||||||
|
rsync -a --delete $sourceDir/ $tempDir
|
||||||
|
|
||||||
|
# Cleaning up the built website
|
||||||
|
find $tempDir \
|
||||||
|
-mindepth 1 -and \
|
||||||
-name "*" -and \
|
-name "*" -and \
|
||||||
-not \( \
|
-not \( \
|
||||||
\( \
|
\( \
|
||||||
-path "$sourceDir/app" \
|
-path "$tempDir/app" -or \
|
||||||
-path "$sourceDir/public" \
|
-path "$tempDir/public" -or \
|
||||||
-path "$sourceDir/vendor" \
|
-path "$tempDir/themes" \
|
||||||
-path "$sourceDir/themes" \
|
|
||||||
\) \
|
\) \
|
||||||
-prune \
|
-prune \
|
||||||
\) -and \
|
\) -and \
|
||||||
-not -name ".env" -and \
|
-not -name ".htaccess" -and \
|
||||||
-not -name ".htaccess" \
|
-not -name "composer.*" \
|
||||||
-print
|
-exec rm -rf {} +
|
||||||
|
|
||||||
rsync -a --delete $sourceDir $tempDir
|
# Cleaning up the destination directory
|
||||||
rsync -a --delete $tempDir/ .
|
find $destinationDir \
|
||||||
rm -rf $tempDir
|
-mindepth 1 -and \
|
||||||
|
-name "*" -and \
|
||||||
|
-not -name ".env" \
|
||||||
|
-exec rm -rf {} +
|
||||||
|
|
||||||
|
# Copying the built website to the destination
|
||||||
|
rsync -a $tempDir/ $destinationDir
|
||||||
|
|
||||||
|
# Installing the website
|
||||||
|
cd $destinationDir
|
||||||
|
composer install
|
||||||
|
./vendor/bin/sake dev/build
|
Loading…
Reference in a new issue