0

Hi I got a docker compose file... with php-apache. In this image I haven't cron... so I installed inside.

Whenever I shut down my lab and restart the whole cron service is down. I always have to start it with "service cron start"

How can I make it always persistent and autostart on restart? Thanks, Alen

 php-apache:
    image: ${phpapache}
    container_name: php-apache 
    hostname: php-apache
    restart: always
    volumes:
       - /etc/app/latest:/var/www/html/
    ports:
      - "8080:80"
ACaps
  • 97
  • 1
  • 8
  • 1
    `service` doesn't usually work inside containers; do you mean that starting a container somehow stops the cron daemon on the host? Are you fundamentally asking [How to run a cron job inside a docker container?](https://stackoverflow.com/questions/37458287/how-to-run-a-cron-job-inside-a-docker-container) (It's almost always in a separate container from your main application.) – David Maze May 04 '23 at 23:57
  • Thanks David for your response... yes maybe it's better to go as you mention and use a dedicated cron docker app. – ACaps May 05 '23 at 13:23

0 Answers0