rewrite with cops internal and only config_local.php external

This commit is contained in:
sparklyballs 2016-08-12 16:42:40 +01:00
parent 01f1795412
commit f8b240e638
5 changed files with 40 additions and 32 deletions

View File

@ -7,13 +7,30 @@ ENV COPS_VER="1.0.0"
# install runtime packages
RUN \
apk add --no-cache \
curl \
php5-dom \
php5-gd \
php5-intl \
php5-openssl \
php5-pdo_sqlite \
tar
php5-pdo_sqlite
# install cops
RUN \
apk add --no-cache --virtual=build-dependencies \
curl \
tar && \
curl -o \
/tmp/cops.tar.gz -L \
"https://github.com/seblucas/cops/archive/${COPS_VER}.tar.gz" && \
mkdir -p \
/usr/share/webapps/cops && \
tar xf /tmp/cops.tar.gz -C \
/usr/share/webapps/cops --strip-components=1 && \
# cleanup
apk del --purge \
build-dependencies && \
rm -rf \
/tmp/*
# add local files
COPY root/ /

View File

@ -41,7 +41,7 @@
* 0 : disable
*/
$config['cops_mail_configuration'] = array( "smtp.host" => "",
$config['cops_mail_configuration'] = array( "smtp.host" => "smtp.gmail.com",
"smtp.username" => "",
"smtp.password" => "",
"smtp.secure" => "ssl",

View File

@ -1,18 +1,13 @@
server {
listen 80 default_server;
listen 443 ssl;
listen 443 ssl;
server_name _;
ssl_certificate /config/keys/cert.crt;
ssl_certificate /config/keys/cert.crt;
ssl_certificate_key /config/keys/cert.key;
access_log /config/log/nginx/access.log;
error_log /config/log/nginx/error.log;
root /config/www/cops;
root /var/www/localhost/cops;
index index.php;
#Useful only for Kobo reader

View File

@ -0,0 +1,16 @@
#!/usr/bin/with-contenv bash
# make symlink
[[ ! -e /var/www/localhost/cops ]] && \
ln -s /usr/share/webapps/cops /var/www/localhost/cops
# copy config
[[ ! -e /config/config_local.php ]] && \
cp /defaults/config_local.php /config/config_local.php
cp /config/config_local.php /var/www/localhost/cops/
# permissions
chown -R abc:abc \
/config \
/usr/share/webapps/cops \
var/www/localhost/cops

View File

@ -1,20 +0,0 @@
#!/usr/bin/with-contenv bash
# install cops
if [ ! -e "/config/www/cops/index.php" ]; then
curl -o \
/tmp/cops.tar.gz -L \
"https://github.com/seblucas/cops/archive/${COPS_VER}.tar.gz"
mkdir -p \
/config/www/cops
tar xf /tmp/cops.tar.gz -C \
/config/www/cops --strip-components=1
fi
# copy config
[[ ! -e /config/www/cops/config_local.php ]] && \
cp /defaults/config_local.php /config/www/cops/config_local.php
# permissions
chown -R abc:abc \
/config/www