| 1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- FROM cloudron/base:2.0.0@sha256:f9fea80513aa7c92fe2e7bf3978b54c8ac5222f47a9a32a7f8833edf0eb5a4f4
- RUN mkdir -p /app/code /app/pkg
- WORKDIR /app/code
- # configure apache
- RUN rm /etc/apache2/sites-enabled/*
- RUN sed -e 's,^ErrorLog.*,ErrorLog "|/bin/cat",' -i /etc/apache2/apache2.conf
- COPY apache/mpm_prefork.conf /etc/apache2/mods-available/mpm_prefork.conf
- COPY apache/lamp.conf /etc/apache2/sites-enabled/lamp.conf
- RUN echo "Listen 80" > /etc/apache2/ports.conf
- RUN a2disconf other-vhosts-access-log
- RUN a2enmod rewrite headers rewrite expires cache
- # configure mod_php
- # default_charset is set due to https://www.saotn.org/php-56-default_charset-change-may-break-html-output/
- RUN crudini --set /etc/php/7.3/apache2/php.ini PHP upload_max_filesize 64M && \
- crudini --set /etc/php/7.3/apache2/php.ini PHP post_max_size 64M && \
- crudini --set /etc/php/7.3/apache2/php.ini PHP memory_limit 128M && \
- crudini --set /etc/php/7.3/apache2/php.ini Session session.save_path /run/sessions && \
- crudini --set /etc/php/7.3/apache2/php.ini Session session.gc_probability 1 && \
- crudini --set /etc/php/7.3/apache2/php.ini Session session.gc_divisor 100 && \
- crudini --set /etc/php/7.3/apache2/php.ini PHP default_charset ""
- # supervisor# configure supervisor
- ADD supervisor/ /etc/supervisor/conf.d/
- RUN sed -e 's,^logfile=.*$,logfile=/run/supervisord.log,' -i /etc/supervisor/supervisord.conf
- # copy website code mind the trailing slash to copy its content to /app/code/ not the folder itself
- ADD website/ /app/code/
- # copy app code
- ADD app /app/code/app
- RUN chown -R www-data.www-data /app/code
- ADD start.sh /app/pkg/
- # RUN sed -i "s/\$host = \".*\";/\$host = \$_ENV[\"MYSQL_HOST\"];/" /app/code/DataBase/database.php
- # RUN sed -i "s/\$user = \".*\";/\$user = \$_ENV[\"MYSQL_USERNAME\"];/" /app/code/DataBase/database.php
- # RUN sed -i "s/\$password = \".*\";/\$password = \$_ENV[\"MYSQL_PASSWORD\"];/" /app/code/DataBase/database.php
- # RUN sed -i "s/\$db = \".*\";/\$db = \$_ENV[\"MYSQL_DATABASE\"];/" /app/code/DataBase/database.php
- CMD [ "/app/pkg/start.sh" ]
|