Skip to content

Commit

Permalink
New dockerfile version that works with the latest NC and passman vers…
Browse files Browse the repository at this point in the history
…ions
  • Loading branch information
animalillo committed Aug 1, 2021
1 parent 1b56824 commit 4157a3d
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 50 deletions.
90 changes: 40 additions & 50 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,26 +1,9 @@
# Nextcloud - passman
#
# @copyright Copyright (c) 2016 Marcos Zuriaga Miguel ([email protected])
# @copyright Copyright (c) 2016 Sander Brand ([email protected])
# @license GNU AGPL version 3 or any later version
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Nextcloud - passman - custom dev container

FROM ubuntu:18.04
FROM ubuntu:20.04
RUN /bin/bash -c "export DEBIAN_FRONTEND=noninteractive" && \
/bin/bash -c "debconf-set-selections <<< 'mariadb-server-10.0 mysql-server/root_password password PASS'" && \
/bin/bash -c "debconf-set-selections <<< 'mariadb-server-10.0 mysql-server/root_password_again password PASS'" && \
/bin/bash -c "debconf-set-selections <<< 'mariadb-server mysql-server/root_password password PASS'" && \
/bin/bash -c "debconf-set-selections <<< 'mariadb-server mysql-server/root_password_again password PASS'" && \
/bin/bash -c "debconf-set-selections <<< 'tzdata tzdata/Zones/Europe select Madrid'" && \
/bin/bash -c "echo \"Europe/Zurich\" > /etc/timezone " && \
/bin/bash -c "ln -fs /usr/share/zoneinfo/`cat /etc/timezone` /etc/localtime" && \
Expand All @@ -30,32 +13,35 @@ RUN /bin/bash -c "export DEBIAN_FRONTEND=noninteractive" && \
cowsay-off \
git \
curl \
libapache2-mod-php7.2 \
libapache2-mod-php7.4 \
mariadb-server \
php7.2 \
php7.2-mysql \
php7.2-curl \
php7.4 \
php7.4-mysql \
php7.4-curl \
php-dompdf \
php7.2-gd \
php7.2-mbstring \
php7.2-xml \
php7.2-zip \
wget
php7.4-gd \
php7.4-mbstring \
php7.4-xml \
php7.4-zip \
php7.4-intl \
php7.4-bcmath \
php7.4-gmp \
php7.4-imagick \
phpunit \
wget \
openssh-server \
npm \
ruby-dev \
composer \
sudo

RUN gem install sass && \
a2enmod ssl && \
ln -s /etc/apache2/sites-available/default-ssl.conf /etc/apache2/sites-enabled && \
git clone https://github.com/nextcloud/passman /var/www/passman && \
cd /var/www/passman && npm install && \
npm install -g grunt-cli

RUN a2enmod ssl
RUN ln -s /etc/apache2/sites-available/default-ssl.conf /etc/apache2/sites-enabled
ADD ./appinfo/ /var/www/passman/appinfo/
ADD ./controller/ /var/www/passman/controller/
ADD ./css/ /var/www/passman/css/
ADD ./img/ /var/www/passman/img/
ADD ./js/ /var/www/passman/js/
ADD ./l10n/ /var/www/passman/l10n/
ADD ./lib/ /var/www/passman/lib/
ADD ./sass/ /var/www/passman/sass/
ADD ./middleware /var/www/passman/middleware
ADD ./templates/* /var/www/passman/templates/
COPY ./*.md /var/www/passman/
COPY ./LICENSE /var/www/passman/
ADD https://raw.githubusercontent.com/nextcloud/travis_ci/master/before_install.sh /var/www/passman

RUN service mysql restart && \
Expand All @@ -67,13 +53,15 @@ RUN service mysql restart && \
cd /var/www/passman && \
chmod +x before_install.sh && \
sleep 1 && \
/bin/bash -c "./before_install.sh passman master mysql; exit 0" && \
/bin/bash -c "./before_install.sh passman stable21 mysql; exit 0" && \
rm /var/www/server/apps/passman/before_install.sh && \
mv /var/www/server/* /var/www/html/ && \
cd /var/www/html/ && \
chmod +x occ && \
service mysql restart && \
./occ maintenance:install --database-name oc_autotest --database-user oc_autotest --admin-user admin --admin-pass admin --database mysql --database-pass 'owncloud' && \
sed -i 's/\/var\/www\/server/\/var\/www\/html/g' /var/www/html/config/config.php && \
cat /var/www/html/config/config.php && \
./occ check && \
./occ status && \
./occ app:list && \
Expand All @@ -87,9 +75,11 @@ RUN service mysql restart && \
chown -R www-data /var/www
EXPOSE 80
EXPOSE 443
ENTRYPOINT service mysql start && \
service apache2 start && \
bash -c "trap 'echo stopping services...; service apache2 stop && service mysql stop && exit 0' SIGTERM SIGKILL; \
tail -f /var/www/html/data/nextcloud.log"

#/usr/games/cowsay -f dragon.cow "you might now login using username:admin password:admin" && \
COPY entrypoint.sh /
RUN chmod +x /entrypoint.sh

ENTRYPOINT ["/entrypoint.sh"]
CMD []

#/usr/games/cowsay -f dragon.cow "you might now login using username:admin password:admin" && \
25 changes: 25 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash

# SIGTERM-handler
term_handler() {
service apache2 stop
service mysql stop
exit 0
}

set -x

service ssh start
service mysql start
service apache2 start


trap 'kill ${!}; term_handler' SIGTERM

/usr/games/cowsay -f dragon.cow "you might now login using username:admin password:admin"

# wait forever
while true
do
tail -f /var/www/html/data/nextcloud.log & wait ${!}
done

0 comments on commit 4157a3d

Please sign in to comment.