-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathDockerfile
More file actions
42 lines (34 loc) · 969 Bytes
/
Copy pathDockerfile
File metadata and controls
42 lines (34 loc) · 969 Bytes
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
FROM php:8.2-fpm-alpine
# Install required system dependencies
RUN apk add --no-cache \
openssl \
libzip-dev \
curl-dev \
oniguruma-dev \
bash
# Install PHP extensions required by Licora
RUN docker-php-ext-install \
pdo \
pdo_mysql \
mysqli \
zip \
curl \
mbstring
# Copy application files
WORKDIR /var/www/html
COPY . /var/www/html/
# Copy configuration files
COPY docker/php.ini /usr/local/etc/php/conf.d/licora.ini
COPY docker/startup.sh /usr/local/bin/startup.sh
# Setup Crontab
RUN echo "0 * * * * php /var/www/html/cron/check_expiring.php" > /etc/crontabs/www-data && \
echo "0 2 * * * php /var/www/html/cron/cleanup.php" >> /etc/crontabs/www-data
# Set correct permissions
RUN chown -R www-data:www-data /var/www/html \
&& chmod -R 755 /var/www/html \
&& chmod +x /usr/local/bin/startup.sh
# Expose PHP-FPM port
EXPOSE 9000
# Set entrypoint
ENTRYPOINT ["/usr/local/bin/startup.sh"]
CMD ["php-fpm"]