diff --git a/README.md b/README.md index 890189a..e7f2c21 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ Before you begin, ensure you have the following installed: 3. **Build and run the Docker container:** ```bash - docker-compose up --build + docker compose up --build ``` This command uses Docker Compose to build and run the container, loading environment variables from the `.env` file. @@ -47,6 +47,16 @@ Before you begin, ensure you have the following installed: - If your application uses additional environment variables, add them to the `.env` file. - Customize the Dockerfile or docker-compose.yml if needed. +## Running as a Cronjob + +To run your application as a daily cronjob at 6 AM, add the following cronjob entry: + +```cron +0 6 * * * docker compose -f /opt/containers/mail-reminder/docker-compose.yml up --build --exit-code-from go-app +``` + +This cronjob will execute the Docker Compose command daily at 6 AM. + ## Contributing If you'd like to contribute, please fork the repository and create a pull request. Feel free to open an issue if you encounter any problems or have suggestions. diff --git a/docker-compose.yml b/docker-compose.yml index 39e2553..caadb77 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -6,10 +6,4 @@ services: context: . env_file: .env volumes: - - /opt/containers/mailu/dav/collection-root:/dav:ro - - cron: - image: alpine:latest - volumes: - - ./cron-job.sh:/etc/periodic/daily/cron-job - command: ["crond", "-f", "-d", "8"] \ No newline at end of file + - /opt/containers/mailu/dav/collection-root:/dav:ro \ No newline at end of file