WinterCMS - Dockerfile for Caprover
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM php:7.4-apache | |
ENV APP_PATH=/var/www/html | |
WORKDIR $APP_PATH | |
# update, upgrade and install package | |
RUN apt update -y && apt upgrade -y \ | |
&& apt-get install -y build-essential | |
# Php extensions | |
COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/ | |
RUN install-php-extensions intl gd pdo_mysql opcache zip @composer-2 | |
COPY .docker/php.ini /usr/local/etc/php/conf.d/app.ini | |
# Apache | |
COPY .docker/vhost.conf /etc/apache2/sites-available/000-default.conf | |
RUN a2enmod rewrite | |
# Copy application source | |
COPY --chown=www-data . $APP_PATH | |
USER www-data | |
RUN composer install --no-dev --optimize-autoloader --no-cache | |
RUN php artisan winter:mirror public \ | |
&& php artisan config:cache \ | |
&& php artisan route:cache | |
# Artisan commands | |
RUN chmod -R 777 $APP_PATH/storage && chown -R www-data:www-data $APP_PATH | |
USER root | |
COPY .docker/entrypoint.sh / | |
EXPOSE 80 | |
ENTRYPOINT ["sh", "/entrypoint.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
runuser -u www-data -- php artisan winter:up | |
apache2-foreground |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
date.timezone = Europe/Paris | |
opcache.enable = 1 | |
opcache.enable_cli = 1 | |
opcache.memory_consumption = 128 | |
opcache.revalidate_freq = 0 | |
apc.enable_cli = On | |
upload_max_filesize = 16M | |
post_max_size = 16M | |
realpath_cache_size = 4096k | |
realpath_cache_ttl = 7200 | |
display_errors = Off | |
display_startup_errors = Off | |
expose_php = Off |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<VirtualHost *:80> | |
ServerAdmin webmaster@localhost | |
DocumentRoot /var/www/html/public | |
<Directory /var/www/html> | |
Options Indexes FollowSymLinks | |
AllowOverride All | |
Require all granted | |
</Directory> | |
</VirtualHost> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment