Sign inSign up

tongkolspace/supervisor

By tongkolspace

Updated about 2 years ago

supervisor & cron docker

Image
0

846

tongkolspace/supervisor repository overview

User :

  • UID 1000 = node
  • UID 33 = www-data

Sample docker Compose

  supervisor:
    image: tongkolspace/supervisor:8.1-v1.0.0
    container_name: workspace-supervisor-${APP_NAME}
    build:
      context: ./workspace
      dockerfile: Dockerfile
    volumes:
      - ./php-fpm/php-dev.ini:/usr/local/etc/php/conf.d/zz-custom-php.ini
      - ../backend:/var/www/html
      - ./supervisor/cron/cronjob-laravel:/tmp/cronjob
      - ./supervisor/supervisor.conf/supervisor-cron.conf:/etc/supervisor/conf.d/supervisor-cron.conf
      - ./supervisor/supervisor.conf/backend.conf:/etc/supervisor/conf.d/backend.conf
    env_file:
      - .env-dev-tonjoo
    environment:
      TZ: "${TZ}"
    networks:
      - internal
      - external

Cronjob sample

* * * * * su -s /bin/sh www-data -c '/usr/local/bin/wp cron event run --due-now --path=/var/www/html/wp' > /proc/1/fd/1 2>&1
00 04 * * * su -s /bin/sh www-data -c '/usr/local/bin/wp cache flush --path=/var/www/html/wp' > /proc/1/fd/1 2>&1

Supervisor Sample

[supervisord]
nodaemon=true

[program:cron]
command=cron -f
autostart=true
autorestart=true

Tag summary

Content type

Image

Digest

sha256:8b12cd2af

Size

400.8 MB

Last updated

about 2 years ago

docker pull tongkolspace/supervisor