File tree Expand file tree Collapse file tree 5 files changed +24
-14
lines changed Expand file tree Collapse file tree 5 files changed +24
-14
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,10 @@ RUN apt-get update \
10
10
libpq-dev \
11
11
libzip-dev \
12
12
unzip \
13
- git
13
+ git \
14
+ cron \
15
+ nano \
16
+ supervisor
14
17
15
18
# Install PHP extensions
16
19
RUN docker-php-ext-install \
@@ -22,22 +25,20 @@ RUN docker-php-ext-install \
22
25
pdo_mysql \
23
26
opcache
24
27
25
- # Install XDEBUG
28
+ # Install XDEBUG, APCU
26
29
RUN pecl install xdebug apcu
27
- # Enable XDEBUG
28
30
RUN docker-php-ext-enable xdebug apcu
29
31
32
+ # Install symfony CLI
30
33
RUN curl -sS https://get.symfony.com/cli/installer | bash
31
34
RUN mv /root/.symfony5/bin/symfony /usr/local/bin/symfony
32
35
33
- # Enable Apache modules
34
- RUN a2enmod rewrite
35
-
36
- # Install Composer and dependencies
36
+ # Install Composer CLI
37
37
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
38
38
39
- # Enable Apache mod_rewrite and mod_headers
40
- RUN a2enmod rewrite headers
39
+ # Setup crontab
40
+ COPY ./crontab /var/www/html/.docker/crontab
41
+ RUN crontab /var/www/html/.docker/crontab
41
42
42
43
# You can add your own aliases here
43
44
RUN echo 'alias console="php /var/www/html/bin/console"' >> ~/.bashrc
@@ -46,8 +47,5 @@ RUN echo 'alias dsu="/var/www/html/bin/console d:s:u --force --complete"' >> ~/.
46
47
47
48
RUN echo "umask 0000" >> /root/.bashrc
48
49
49
- # Expose port 80 for Apache
50
- EXPOSE 80
51
-
52
- # Start Apache server
53
- CMD ["apache2-foreground" ]
50
+ # Start Supervisor, which will run cron -f by default.
51
+ CMD ["/usr/bin/supervisord" ]
Original file line number Diff line number Diff line change
1
+ * * * * * touch /var/www/html/.idea/file_from_crontab
Original file line number Diff line number Diff line change
1
+ [supervisord]
2
+ nodaemon=true
3
+
4
+ [program:cron]
5
+ command=cron -f
6
+ autostart=true
7
+ autorestart=true
8
+ stdout_logfile=/var/log/cron.log
9
+ stderr_logfile=/var/log/cron_error.log
Original file line number Diff line number Diff line change
1
+ .idea
Original file line number Diff line number Diff line change @@ -35,6 +35,7 @@ services:
35
35
volumes :
36
36
- ./:/var/www/html
37
37
- ./.docker/virtualhost.conf:/etc/apache2/sites-available/000-default.conf
38
+ - ./.docker/supervisord.conf:/etc/supervisor/conf.d/supervisord.conf
38
39
ports :
39
40
- " 80:80"
40
41
depends_on :
You can’t perform that action at this time.
0 commit comments