Skip to content

Commit 1d9b25c

Browse files
committed
Added new bin/cron to start cron service #540
1 parent 3b480b6 commit 1d9b25c

File tree

11 files changed

+8
-39
lines changed

11 files changed

+8
-39
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,7 @@ It is recommended to keep your root docker config files in one repository, and y
246246
- `bin/composer`: Run the composer binary. Ex. `bin/composer install`
247247
- `bin/copyfromcontainer`: Copy folders or files from container to host. Ex. `bin/copyfromcontainer vendor`
248248
- `bin/copytocontainer`: Copy folders or files from host to container. Ex. `bin/copytocontainer --all`
249+
- `bin/cron`: Start or stop the cron service. Ex. `bin/cron start`
249250
- `bin/dev-urn-catalog-generate`: Generate URN's for PHPStorm and remap paths to local host. Restart PHPStorm after running this command.
250251
- `bin/devconsole`: Alias for `bin/n98-magerun2 dev:console`
251252
- `bin/download`: Download specific Magento version from Composer to `/var/www/html` directory within the container. Ex. `bin/download 2.4.3-p1 community`

compose/Makefile

+2-1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ help:
2828
@echo "$(call format,make,composer,'Run the composer binary.')"
2929
@echo "$(call format,make,copyfromcontainer,'Copy folders or files from container to host.')"
3030
@echo "$(call format,make,copytocontainer,'Copy folders or files from host to container.')"
31+
@echo "$(call format,make,cron,'Start or stop the cron service.')"
3132
@echo "$(call format,make,dev-urn-catalog-generate,'Generate URNs for PHPStorm and remap paths to local host.')"
3233
@echo "$(call format,make,devconsole,'Alias for n98-magerun2 dev:console.')"
3334
@echo "$(call format,make,devtools-cli-check,'Check & install the CLI devtools if missing from system.')"
@@ -175,4 +176,4 @@ update:
175176
@./bin/update
176177

177178
xdebug:
178-
@./bin/xdebug $(call args)
179+
@./bin/xdebug $(call args)

compose/bin/cron

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash
2+
[ -z "$1" ] && echo "Please specify a CLI command (ex. ls)" && exit
3+
bin/root service cron "$@"
4+
bin/root touch /var/www/html/var/.setup_cronjob_status /var/www/html/var/.update_cronjob_status
5+
bin/root chown app:app /var/www/html/var/.setup_cronjob_status /var/www/html/var/.update_cronjob_status

compose/docker-compose.dev.yml

-4
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,6 @@ services:
3636
ports:
3737
- "1080:1080"
3838

39-
## Disabling cron by default as it uses higher CPU, enable if needed
40-
#cron:
41-
# volumes: *appvolumes
42-
4339
# Disabling selenium by default as it is not required for all use cases
4440
#selenium:
4541
# image: selenium/standalone-chrome-debug:3.8.1

compose/docker-compose.yml

-10
Original file line numberDiff line numberDiff line change
@@ -62,16 +62,6 @@ services:
6262
environment:
6363
- RABBITMQ_VM_MEMORY_HIGH_WATERMARK=1GB
6464

65-
## Disabling cron by default as it uses higher CPU, enable if needed
66-
#cron:
67-
# image: markoshust/magento-php:7.4-fpm-9
68-
# user: root
69-
# command: /usr/local/bin/cronstart
70-
# tty: true
71-
# links:
72-
# - db
73-
# volumes: *appvolumes
74-
7565
volumes:
7666
appdata:
7767
dbdata:

images/php/7.3/Dockerfile

-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ RUN curl -s https://packages.blackfire.io/gpg.key | apt-key add - \
9595
COPY conf/www.conf /usr/local/etc/php-fpm.d/
9696
COPY conf/php.ini /usr/local/etc/php/
9797
COPY conf/php-fpm.conf /usr/local/etc/
98-
COPY bin/cronstart /usr/local/bin/
9998

10099
RUN mkdir -p /etc/nginx/html /var/www/html /sock \
101100
&& chown -R app:app /etc/nginx /var/www /usr/local/etc/php/conf.d /sock

images/php/7.3/bin/cronstart

-7
This file was deleted.

images/php/7.4/Dockerfile

-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ RUN curl -s https://packages.blackfire.io/gpg.key | apt-key add - \
9595
COPY conf/www.conf /usr/local/etc/php-fpm.d/
9696
COPY conf/php.ini /usr/local/etc/php/
9797
COPY conf/php-fpm.conf /usr/local/etc/
98-
COPY bin/cronstart /usr/local/bin/
9998

10099
RUN mkdir -p /etc/nginx/html /var/www/html /sock \
101100
&& chown -R app:app /etc/nginx /var/www /usr/local/etc/php/conf.d /sock

images/php/7.4/bin/cronstart

-7
This file was deleted.

images/php/8.0/Dockerfile

-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ RUN curl -s https://packages.blackfire.io/gpg.key | apt-key add - \
7878
COPY conf/www.conf /usr/local/etc/php-fpm.d/
7979
COPY conf/php.ini /usr/local/etc/php/
8080
COPY conf/php-fpm.conf /usr/local/etc/
81-
COPY bin/cronstart /usr/local/bin/
8281

8382
RUN mkdir -p /etc/nginx/html /var/www/html /sock \
8483
&& chown -R app:app /etc/nginx /var/www /usr/local/etc/php/conf.d /sock

images/php/8.0/bin/cronstart

-7
This file was deleted.

0 commit comments

Comments
 (0)