Skip to content

Instantly share code, notes, and snippets.

Created May 4, 2021 14:51
What would you like to do?
WinterCMS - Dockerfile for Caprover
FROM php:7.4-apache
ENV APP_PATH=/var/www/html
# 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", "/"]
runuser -u www-data -- php artisan winter:up
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
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html/public
<Directory /var/www/html>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment