-
Notifications
You must be signed in to change notification settings - Fork 91
/
Copy pathDockerfile
98 lines (84 loc) · 2.63 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
#
# October CMS installer
#
# Create image with:
# docker build -t myoctober:latest .
#
# Open installer with:
# http://localhost:port/install.php
#
FROM php:8.2-apache
LABEL maintainer="October CMS <hello@octobercms.com> (@octobercms)"
# Installs dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
unzip \
wget \
libfreetype6-dev \
libjpeg62-turbo-dev \
libpng-dev \
libyaml-dev \
libwebp-dev \
libzip4 \
libzip-dev \
zlib1g-dev \
libicu-dev \
libpq-dev \
libsqlite3-dev \
g++ \
git \
cron \
vim \
nano \
ssh-client \
&& docker-php-ext-install opcache \
&& docker-php-ext-configure intl \
&& docker-php-ext-install intl \
&& docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp \
&& docker-php-ext-install -j$(nproc) gd \
&& docker-php-ext-install zip \
&& docker-php-ext-install exif \
&& docker-php-ext-install mysqli \
&& docker-php-ext-install pdo_pgsql \
&& docker-php-ext-install pdo_mysql \
&& rm -rf /var/lib/apt/lists/*
# Sets recommended PHP.ini settings (https://secure.php.net/manual/en/opcache.installation.php)
RUN { \
echo 'opcache.memory_consumption=128'; \
echo 'opcache.interned_strings_buffer=8'; \
echo 'opcache.max_accelerated_files=4000'; \
echo 'opcache.revalidate_freq=2'; \
echo 'opcache.fast_shutdown=1'; \
echo 'opcache.enable_cli=1'; \
echo 'upload_max_filesize=128M'; \
echo 'post_max_size=128M'; \
echo 'expose_php=off'; \
} > /usr/local/etc/php/conf.d/php-recommended.ini
RUN pecl install apcu \
&& pecl install yaml-2.2.2 \
&& docker-php-ext-enable apcu yaml
# Enables apache rewrite w/ security
RUN a2enmod rewrite expires && \
sed -i 's/ServerTokens OS/ServerTokens ProductOnly/g' \
/etc/apache2/conf-available/security.conf
# Install composer
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
# Create html directory
RUN mkdir -p /var/www/html && chown -R www-data:www-data /var/www/html
# Sets user to www-data
USER www-data
# Adds installer
WORKDIR /var/www/html
# Download the zip file
RUN wget -O installer.zip https://github.com/octobercms/install/archive/refs/heads/master.zip
# Unzip the downloaded file
RUN unzip installer.zip -d /var/www/html && \
mv /var/www/html/install-master/* /var/www/html/ && \
rm -r /var/www/html/install-master && \
rm installer.zip
# Returns to root user
USER root
# Expose the default port
EXPOSE 80/tcp
# Provides container inside image for data persistence
VOLUME ["/var/www/html"]
CMD ["apache2-foreground"]