Skip to content

Commit

Permalink
Entrypoint变化
Browse files Browse the repository at this point in the history
  • Loading branch information
AkarinLiu committed Mar 25, 2024
1 parent e639e95 commit b3328b8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
14 changes: 3 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,8 @@ RUN a2enmod rewrite
COPY php.ini /etc/php/8.2/apache2/php.ini
COPY 000-default.conf /etc/apache2/sites-available/000-default.conf
RUN composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/
ENTRYPOINT if [ -f /var/www/html/site.php ]; then \
echo 'skipping...'; \
else \
echo 'Downloading Flarum...'; \
rm -rf /var/www/html/* ; \
composer create-project flarum/flarum /var/www/html ; \
chown -R www-data:www-data /var/www/html/ ; \
chmod -R 755 /var/www/html/ ; \
echo 'Flarum installed.' \
fi
COPY docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod +x /docker-entrypoint.sh
VOLUME [ "/var/www/html" ]
EXPOSE 80
CMD ["apache2ctl", "-D", "FOREGROUND"]
ENTRYPOINT [ "/docker-entrypoint.sh" ]
11 changes: 11 additions & 0 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
if [ -f /var/www/html/site.php ]; then
echo "Starting Flarum..."
apache2ctl -D FOREGROUND
else
echo "Installing Flarum..."
composer create-project flarum/flarum /var/www/html
chown -R www-data:www-data /var/www/html
chmod -R 755 /var/www/html
echo "Starting Flarum..."
apache2ctl -D FOREGROUND
fi

0 comments on commit b3328b8

Please sign in to comment.