mirror of
https://github.com/filegator/filegator.git
synced 2025-08-13 20:34:00 +02:00
new Dockerfile
This commit is contained in:
69
Dockerfile
69
Dockerfile
@@ -1,35 +1,58 @@
|
|||||||
|
#################################
|
||||||
|
# stage builder: build and test
|
||||||
|
#################################
|
||||||
|
FROM php:7-apache-buster AS builder
|
||||||
|
|
||||||
|
RUN curl -sL https://deb.nodesource.com/setup_14.x | bash -
|
||||||
|
|
||||||
|
RUN apt-get update > /dev/null
|
||||||
|
RUN apt-get install -y git libzip-dev nodejs python2 libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 libxtst6 xauth xvfb
|
||||||
|
|
||||||
|
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
|
||||||
|
|
||||||
|
RUN docker-php-ext-install zip
|
||||||
|
RUN docker-php-ext-enable zip
|
||||||
|
|
||||||
|
RUN git clone https://github.com/filegator/filegator.git /var/www/filegator/
|
||||||
|
WORKDIR "/var/www/filegator/"
|
||||||
|
RUN cp configuration_sample.php configuration.php
|
||||||
|
RUN composer install
|
||||||
|
RUN composer require league/flysystem-sftp:^1.0 -W
|
||||||
|
RUN composer require league/flysystem-aws-s3-v3:^1.0 -W
|
||||||
|
RUN npm install
|
||||||
|
RUN npm run build
|
||||||
|
RUN vendor/bin/phpunit
|
||||||
|
RUN npm run lint
|
||||||
|
#RUN npm run e2e
|
||||||
|
RUN rm -rf node_modules frontend tests docs .git*
|
||||||
|
|
||||||
|
#################################
|
||||||
|
# stage production
|
||||||
|
#################################
|
||||||
FROM php:7-apache-buster
|
FROM php:7-apache-buster
|
||||||
|
|
||||||
ENV APACHE_DOCUMENT_ROOT=/var/www/filegator/dist/
|
RUN apt-get update > /dev/null
|
||||||
|
RUN apt-get install -y git libzip-dev libldap2-dev
|
||||||
|
|
||||||
RUN apt-get update > /dev/null && \
|
RUN docker-php-ext-install zip ldap
|
||||||
# Install and enable php zip extension
|
RUN docker-php-ext-enable zip ldap
|
||||||
apt-get install -y wget unzip libzip-dev && \
|
|
||||||
docker-php-ext-install zip && \
|
COPY --from=builder /var/www/filegator /var/www/filegator
|
||||||
docker-php-ext-enable zip && \
|
RUN chown -R www-data:www-data /var/www/filegator/
|
||||||
# Download and extract latest build
|
WORKDIR "/var/www/filegator/"
|
||||||
cd /var/www/ && \
|
RUN chmod -R g+w private/
|
||||||
wget https://github.com/filegator/static/raw/master/builds/filegator_latest.zip && \
|
RUN chmod -R g+w repository/
|
||||||
unzip filegator_latest.zip && rm filegator_latest.zip && \
|
|
||||||
chown -R www-data:www-data filegator/ && \
|
ENV APACHE_DOCUMENT_ROOT=/var/www/filegator/dist/
|
||||||
chmod -R 775 filegator/ && \
|
RUN sed -ri -e 's!/var/www/html!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/sites-available/*.conf
|
||||||
# configure Apache to use the value of APACHE_DOCUMENT_ROOT as its default Document Root
|
RUN sed -ri -e 's!/var/www/!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf
|
||||||
sed -ri -e 's!/var/www/html!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/sites-available/*.conf && \
|
RUN a2enmod rewrite
|
||||||
sed -ri -e 's!/var/www/!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf && \
|
|
||||||
# configure php
|
|
||||||
mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini" && \
|
|
||||||
# cleanup apt
|
|
||||||
apt-get purge -y wget unzip && \
|
|
||||||
apt-get autoclean -y && \
|
|
||||||
rm -Rf /var/lib/apt/lists/*
|
|
||||||
|
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
|
|
||||||
VOLUME /var/www/filegator/repository
|
VOLUME /var/www/filegator/repository
|
||||||
VOLUME /var/www/filegator/private
|
VOLUME /var/www/filegator/private
|
||||||
|
|
||||||
WORKDIR "/var/www/filegator/"
|
|
||||||
|
|
||||||
USER www-data
|
USER www-data
|
||||||
|
|
||||||
CMD ["apache2-foreground"]
|
CMD ["apache2-foreground"]
|
||||||
|
Reference in New Issue
Block a user