| | |
| | FROM php:7.4-apache |
| |
|
| | |
| | ENV LANG C.UTF-8 |
| | ENV LC_ALL C.UTF-8 |
| |
|
| | |
| | RUN apt-get update && apt-get install -y \ |
| | libzip-dev \ |
| | zip \ |
| | && docker-php-ext-install zip |
| |
|
| | |
| | RUN apt-get clean && rm -rf /var/lib/apt/lists/* |
| |
|
| | |
| | ARG APACHE_PASSWORD |
| |
|
| | |
| | |
| |
|
| | |
| | ENV APACHE_PASSWORD_ENV=$APACHE_PASSWORD |
| |
|
| | |
| | COPY . /var/www/html |
| |
|
| | |
| | RUN apt-get update && apt-get install -y unzip apache2-utils |
| |
|
| | |
| | WORKDIR /var/www/html |
| |
|
| | |
| | |
| | |
| | RUN chmod 777 albums albums/* |
| |
|
| | |
| | |
| | |
| | |
| | RUN echo -bc /etc/apache2/.htpasswd admin "$APACHE_PASSWORD" |
| | RUN htpasswd -bc /etc/apache2/.htpasswd admin "$APACHE_PASSWORD" |
| |
|
| | |
| | RUN chmod 644 /etc/apache2/.htpasswd |
| |
|
| | |
| | RUN chown www-data:www-data /etc/apache2/.htpasswd |
| |
|
| | |
| | RUN echo "<Directory \"/var/www/html\">\\n" \ |
| | "AuthType Basic\\n" \ |
| | "AuthName \"Restricted Content\"\\n" \ |
| | "AuthUserFile /etc/apache2/.htpasswd\\n" \ |
| | "Require valid-user\\n" \ |
| | "</Directory>" > /etc/apache2/conf-available/auth.conf |
| |
|
| | |
| | RUN a2enconf auth |
| |
|
| | |
| | EXPOSE 7860 |
| |
|
| | |
| | RUN sed -i 's/80/7860/' /etc/apache2/ports.conf |
| | RUN sed -i 's/:80/:7860/' /etc/apache2/sites-available/000-default.conf |
| |
|
| | |
| | CMD ["apache2-foreground"] |
| |
|