Skip to content

Commit

Permalink
Added new bin/cron to start cron service #540
Browse files Browse the repository at this point in the history
  • Loading branch information
markshust committed Oct 14, 2021
1 parent 3b480b6 commit 1d9b25c
Show file tree
Hide file tree
Showing 11 changed files with 8 additions and 39 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ It is recommended to keep your root docker config files in one repository, and y
- `bin/composer`: Run the composer binary. Ex. `bin/composer install`
- `bin/copyfromcontainer`: Copy folders or files from container to host. Ex. `bin/copyfromcontainer vendor`
- `bin/copytocontainer`: Copy folders or files from host to container. Ex. `bin/copytocontainer --all`
- `bin/cron`: Start or stop the cron service. Ex. `bin/cron start`
- `bin/dev-urn-catalog-generate`: Generate URN's for PHPStorm and remap paths to local host. Restart PHPStorm after running this command.
- `bin/devconsole`: Alias for `bin/n98-magerun2 dev:console`
- `bin/download`: Download specific Magento version from Composer to `/var/www/html` directory within the container. Ex. `bin/download 2.4.3-p1 community`
Expand Down
3 changes: 2 additions & 1 deletion compose/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ help:
@echo "$(call format,make,composer,'Run the composer binary.')"
@echo "$(call format,make,copyfromcontainer,'Copy folders or files from container to host.')"
@echo "$(call format,make,copytocontainer,'Copy folders or files from host to container.')"
@echo "$(call format,make,cron,'Start or stop the cron service.')"
@echo "$(call format,make,dev-urn-catalog-generate,'Generate URNs for PHPStorm and remap paths to local host.')"
@echo "$(call format,make,devconsole,'Alias for n98-magerun2 dev:console.')"
@echo "$(call format,make,devtools-cli-check,'Check & install the CLI devtools if missing from system.')"
Expand Down Expand Up @@ -175,4 +176,4 @@ update:
@./bin/update

xdebug:
@./bin/xdebug $(call args)
@./bin/xdebug $(call args)
5 changes: 5 additions & 0 deletions compose/bin/cron
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash
[ -z "$1" ] && echo "Please specify a CLI command (ex. ls)" && exit
bin/root service cron "$@"
bin/root touch /var/www/html/var/.setup_cronjob_status /var/www/html/var/.update_cronjob_status
bin/root chown app:app /var/www/html/var/.setup_cronjob_status /var/www/html/var/.update_cronjob_status
4 changes: 0 additions & 4 deletions compose/docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,6 @@ services:
ports:
- "1080:1080"

## Disabling cron by default as it uses higher CPU, enable if needed
#cron:
# volumes: *appvolumes

# Disabling selenium by default as it is not required for all use cases
#selenium:
# image: selenium/standalone-chrome-debug:3.8.1
Expand Down
10 changes: 0 additions & 10 deletions compose/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,16 +62,6 @@ services:
environment:
- RABBITMQ_VM_MEMORY_HIGH_WATERMARK=1GB

## Disabling cron by default as it uses higher CPU, enable if needed
#cron:
# image: markoshust/magento-php:7.4-fpm-9
# user: root
# command: /usr/local/bin/cronstart
# tty: true
# links:
# - db
# volumes: *appvolumes

volumes:
appdata:
dbdata:
Expand Down
1 change: 0 additions & 1 deletion images/php/7.3/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ RUN curl -s https://packages.blackfire.io/gpg.key | apt-key add - \
COPY conf/www.conf /usr/local/etc/php-fpm.d/
COPY conf/php.ini /usr/local/etc/php/
COPY conf/php-fpm.conf /usr/local/etc/
COPY bin/cronstart /usr/local/bin/

RUN mkdir -p /etc/nginx/html /var/www/html /sock \
&& chown -R app:app /etc/nginx /var/www /usr/local/etc/php/conf.d /sock
Expand Down
7 changes: 0 additions & 7 deletions images/php/7.3/bin/cronstart

This file was deleted.

1 change: 0 additions & 1 deletion images/php/7.4/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ RUN curl -s https://packages.blackfire.io/gpg.key | apt-key add - \
COPY conf/www.conf /usr/local/etc/php-fpm.d/
COPY conf/php.ini /usr/local/etc/php/
COPY conf/php-fpm.conf /usr/local/etc/
COPY bin/cronstart /usr/local/bin/

RUN mkdir -p /etc/nginx/html /var/www/html /sock \
&& chown -R app:app /etc/nginx /var/www /usr/local/etc/php/conf.d /sock
Expand Down
7 changes: 0 additions & 7 deletions images/php/7.4/bin/cronstart

This file was deleted.

1 change: 0 additions & 1 deletion images/php/8.0/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ RUN curl -s https://packages.blackfire.io/gpg.key | apt-key add - \
COPY conf/www.conf /usr/local/etc/php-fpm.d/
COPY conf/php.ini /usr/local/etc/php/
COPY conf/php-fpm.conf /usr/local/etc/
COPY bin/cronstart /usr/local/bin/

RUN mkdir -p /etc/nginx/html /var/www/html /sock \
&& chown -R app:app /etc/nginx /var/www /usr/local/etc/php/conf.d /sock
Expand Down
7 changes: 0 additions & 7 deletions images/php/8.0/bin/cronstart

This file was deleted.

0 comments on commit 1d9b25c

Please sign in to comment.