-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
44 lines (36 loc) · 1.72 KB
/
Copy pathDockerfile
File metadata and controls
44 lines (36 loc) · 1.72 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
# Official Apache + PHP 8.2 Base Image
FROM php:8.2-apache
# Install system dependencies and PHP extensions required by WorkFlow
RUN apt-get update && apt-get install -y \
libpng-dev \
libjpeg-dev \
libfreetype6-dev \
zip \
unzip \
git \
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
&& docker-php-ext-install -j$(nproc) gd mysqli pdo_mysql \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
# Enable Apache mod_rewrite and configure AllowOverride for .htaccess support
RUN a2enmod rewrite && \
echo '<Directory /var/www/html/>\n\tOptions +FollowSymlinks -Indexes\n\tAllowOverride All\n\tRequire all granted\n</Directory>' > /etc/apache2/conf-available/workflow-override.conf && \
a2enconf workflow-override
# Raise PHP's upload limits from the stock 2M/8M defaults -- Knowledge Hub and
# Team Chat both accept file uploads, and a reverse proxy in front (nginx
# client_max_body_size) can only raise the ceiling, not PHP's own lower one.
RUN echo 'upload_max_filesize = 20M\npost_max_size = 25M' > /usr/local/etc/php/conf.d/workflow-uploads.ini
# Set working directory
WORKDIR /var/www/html
# Copy application files into container root
COPY . /var/www/html/
# Ensure required directories and files have proper web server write permissions
RUN mkdir -p /var/www/html/uploads && \
chown -R www-data:www-data /var/www/html/uploads /var/www/html/setup && \
touch /var/www/html/config.php /var/www/html/error.log && \
chown www-data:www-data /var/www/html/config.php /var/www/html/error.log && \
chmod 664 /var/www/html/config.php /var/www/html/error.log && \
chmod 775 /var/www/html/uploads
# Expose HTTP port 80
EXPOSE 80
# Start Apache in foreground
CMD ["apache2-foreground"]