-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.cron.dev
More file actions
54 lines (44 loc) · 1.38 KB
/
Dockerfile.cron.dev
File metadata and controls
54 lines (44 loc) · 1.38 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
FROM php:8.3-cli
ARG DB_USER
ARG DB_PASSWORD
ARG DB_HOST
ARG RESEND_API_KEY
ARG REDIS_HOST
ARG REDIS_PORT
ENV DB_USER=${DB_USER}
ENV DB_PASSWORD=${DB_PASSWORD}
ENV DB_HOST=${DB_HOST}
ENV RESEND_API_KEY=${RESEND_API_KEY}
ENV REDIS_HOST=${REDIS_HOST}
ENV REDIS_PORT=${REDIS_PORT}
LABEL maintainer="JohnQDeveloper <public@JohnQDeveloper.com>"
# Install PHP extensions (same as main container)
RUN apt-get update && apt-get install -y \
libpng-dev \
libjpeg-dev \
libfreetype6-dev \
libzip-dev \
libicu-dev \
cron \
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
&& docker-php-ext-install -j$(nproc) \
pdo_mysql \
gd \
intl \
zip \
opcache \
&& pecl install redis \
&& docker-php-ext-enable redis \
&& rm -rf /var/lib/apt/lists/*
# Fix cron not executing jobs in Docker: pam_loginuid.so fails without CAP_AUDIT_WRITE
RUN sed -i 's/session\s*required\s*pam_loginuid.so/session optional pam_loginuid.so/' /etc/pam.d/cron
# Copy PHP configuration
COPY "web_container_files/php.ini-development" "/usr/local/etc/php/php.ini"
# Set working directory
WORKDIR /app
# Copy application files
COPY . /app
# Copy entrypoint script
COPY "cron_container_files/docker-entrypoint-cron.sh" "/usr/local/bin/docker-entrypoint.sh"
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]