Compare commits
2 commits
b1cc1cca39
...
3e4e0c8358
Author | SHA1 | Date | |
---|---|---|---|
Manuel Thalmann | 3e4e0c8358 | ||
Manuel Thalmann | dd6559a4aa |
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
|
|
@ -11,7 +11,7 @@ LICENSE
|
|||
.vscode
|
||||
|
||||
# SilverStripe auto-generated content
|
||||
Website/silverstripe-cache/
|
||||
Website/vendor/
|
||||
Website/resources/
|
||||
Website/public/resources/
|
||||
/silverstripe-cache/
|
||||
/vendor/
|
||||
/resources/
|
||||
/public/resources/
|
7
.gitignore
vendored
7
.gitignore
vendored
|
@ -4,3 +4,10 @@ composer.phar
|
|||
# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control
|
||||
# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file
|
||||
# composer.lock
|
||||
|
||||
# SvilerStripe files
|
||||
/silverstripe-cache/
|
||||
/vendor/
|
||||
/themes/simple/
|
||||
/resources/
|
||||
/public/resources/
|
||||
|
|
4
.vscode/tasks.json
vendored
4
.vscode/tasks.json
vendored
|
@ -4,10 +4,10 @@
|
|||
"version": "2.0.0",
|
||||
"tasks": [
|
||||
{
|
||||
"label": "Lint Website",
|
||||
"label": "Lint PHP-Code",
|
||||
"type": "shell",
|
||||
"options": {
|
||||
"cwd": "${workspaceFolder}/Website"
|
||||
"cwd": "${workspaceFolder}"
|
||||
},
|
||||
"command": "composer",
|
||||
"args": [
|
||||
|
|
16
Dockerfile
16
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 apt update -y
|
||||
|
@ -8,6 +9,8 @@ RUN apt install --no-install-recommends -y \
|
|||
libtidy-dev \
|
||||
libzip-dev \
|
||||
mysql-client \
|
||||
netcat \
|
||||
rsync \
|
||||
sudo \
|
||||
unzip \
|
||||
zip
|
||||
|
@ -33,13 +36,16 @@ RUN docker-php-ext-enable \
|
|||
ADD https://getcomposer.org/installer composer-setup.php
|
||||
RUN php composer-setup.php
|
||||
RUN mv composer.phar /usr/local/bin/composer
|
||||
COPY --chown=www-data:www-data ./Website/composer.* ./
|
||||
COPY --chown=www-data:www-data ./composer.* ./
|
||||
RUN sudo -u www-data mkdir public
|
||||
RUN sudo -u www-data composer install
|
||||
|
||||
COPY --chown=www-data:www-data .docker/.env .env
|
||||
RUN ./vendor/bin/sake installsake
|
||||
|
||||
COPY .docker/xdebug.ini $PHP_INI_DIR/conf.d/
|
||||
COPY .docker/date.ini $PHP_INI_DIR/conf.d/
|
||||
COPY --chown=www-data:www-data ./Website/ ./
|
||||
|
||||
COPY --chown=www-data:www-data .docker/.env .env
|
||||
COPY --chown=www-data:www-data ./ ../app
|
||||
RUN sudo -u www-data composer vendor-expose
|
||||
|
||||
CMD [ "nuth-start" ]
|
6
Website/.gitignore
vendored
6
Website/.gitignore
vendored
|
@ -1,6 +0,0 @@
|
|||
/silverstripe-cache/
|
||||
/.env
|
||||
/vendor/
|
||||
/themes/simple/
|
||||
/resources/
|
||||
/public/resources/
|
0
Website/composer.lock → composer.lock
generated
0
Website/composer.lock → composer.lock
generated
|
@ -11,6 +11,8 @@ services:
|
|||
- nuth
|
||||
ports:
|
||||
- 8000:80
|
||||
depends_on:
|
||||
- db
|
||||
db:
|
||||
image: mysql:5
|
||||
networks:
|
||||
|
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
|
@ -1,20 +1,40 @@
|
|||
#!/bin/bash
|
||||
cd $(dirname $0)
|
||||
cd ..
|
||||
destinationDir=$(pwd)
|
||||
tempDir=$(mktemp -d)
|
||||
sourceDir="."
|
||||
|
||||
find $sourceDir \
|
||||
cd $(dirname $0)
|
||||
cd ..
|
||||
|
||||
rsync -a --delete $sourceDir/ $tempDir
|
||||
|
||||
# Cleaning up the built website
|
||||
find $tempDir \
|
||||
-mindepth 1 -and \
|
||||
-name "*" -and \
|
||||
-not \( \
|
||||
\( \
|
||||
-path "Website"
|
||||
-path "$tempDir/app" -or \
|
||||
-path "$tempDir/public" -or \
|
||||
-path "$tempDir/themes" \
|
||||
\) \
|
||||
-prune \
|
||||
\) -and \
|
||||
-not -name ".env" \
|
||||
-print
|
||||
-not -name ".htaccess" -and \
|
||||
-not -name "composer.*" \
|
||||
-exec rm -rf {} +
|
||||
|
||||
rsync -a --delete $sourceDir $tempDir
|
||||
rsync -a --delete $tempDir/ .
|
||||
rm -rf $tempDir
|
||||
# Cleaning up the destination directory
|
||||
find $destinationDir \
|
||||
-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