forked from litecart/litecart
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
62 lines (52 loc) · 1.93 KB
/
Dockerfile
File metadata and controls
62 lines (52 loc) · 1.93 KB
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
FROM php:8.3-apache
# Install PHP extensions required by LiteCart
RUN apt-get update && apt-get install -y \
libfreetype6-dev \
libjpeg62-turbo-dev \
libpng-dev \
libzip-dev \
libicu-dev \
libcurl4-openssl-dev \
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
&& docker-php-ext-install -j$(nproc) \
gd \
mysqli \
pdo_mysql \
zip \
intl \
curl \
opcache \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
# Enable Apache modules
RUN a2enmod rewrite headers expires
# Set recommended PHP settings for LiteCart
RUN { \
echo 'upload_max_filesize = 50M'; \
echo 'post_max_size = 50M'; \
echo 'memory_limit = 256M'; \
echo 'max_execution_time = 300'; \
echo 'session.save_path = /tmp'; \
echo 'date.timezone = UTC'; \
echo 'expose_php = Off'; \
} > /usr/local/etc/php/conf.d/litecart.ini
# Set Apache document root to public_html
ENV APACHE_DOCUMENT_ROOT=/var/www/html/public_html
RUN sed -ri -e 's!/var/www/html!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/sites-available/*.conf \
&& sed -ri -e 's!/var/www/!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf
# Allow .htaccess overrides
RUN sed -ri -e 's/AllowOverride None/AllowOverride All/g' /etc/apache2/apache2.conf
# Copy application files
COPY public_html/ /var/www/html/public_html/
# Copy entrypoint script
COPY docker-entrypoint.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
# Set correct permissions
RUN chown -R www-data:www-data /var/www/html/public_html \
&& chmod -R 755 /var/www/html/public_html \
&& chmod -R 775 /var/www/html/public_html/cache \
&& chmod -R 775 /var/www/html/public_html/data \
&& chmod -R 775 /var/www/html/public_html/images \
&& chmod -R 775 /var/www/html/public_html/logs \
&& chmod -R 755 /var/www/html/public_html/vmods
EXPOSE 80
ENTRYPOINT ["docker-entrypoint.sh"]