Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
4rthem committed Oct 17, 2023
1 parent 9861a06 commit 014add7
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 1 deletion.
4 changes: 4 additions & 0 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ services:
- ./expose/api:/srv/app
- ./expose/api/docker/supervisor:/etc/supervisor.d

expose-cron:
volumes:
- ./expose/api:/srv/app

uploader-api-php:
environment:
- XDEBUG_ENABLED
Expand Down
5 changes: 5 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,11 @@ services:
extra_hosts:
- zippy-svc.${PHRASEA_DOMAIN}:${PS_GATEWAY_IP}

expose-cron:
extends:
service: expose-worker
command: ['/srv/app/docker/cron/start-cron.sh']

expose-api-nginx:
profiles:
- expose
Expand Down
3 changes: 3 additions & 0 deletions expose/api/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,7 @@ RUN apk add --no-cache \

COPY docker/supervisor/* /etc/supervisor.d/

RUN touch /var/log/cron.log \
&& chmod 755 /srv/app/docker/cron/scripts/*.sh

CMD ["/bin/sh", "-c", "/usr/bin/supervisord -n"]
1 change: 1 addition & 0 deletions expose/api/docker/cron/app-crontab
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
30 4 * * * /srv/app/docker/cron/scripts/matomo-sync-phraseanet.sh 2>&1
4 changes: 4 additions & 0 deletions expose/api/docker/cron/scripts/matomo-sync-phraseanet.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh

cd /srv/app \
&& bin/console app:matomo:sync-phraseanet
13 changes: 13 additions & 0 deletions expose/api/docker/cron/start-cron.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/sh

set -e

/usr/bin/crontab /srv/app/docker/cron/app-crontab

printenv | grep -v "no_proxy" >> /etc/environment

for script in /srv/app/docker/cron/scripts/*.sh; do
"$script"
done

/usr/sbin/crond -f -l 2
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace App;
namespace App\Command;

use App\Matomo\MatomoClient;
use App\Matomo\PhraseanetClient;
Expand Down

0 comments on commit 014add7

Please sign in to comment.