Replace with the Host-Cronjob
This commit is contained in:
parent
222fc32816
commit
f841326c1f
2 changed files with 12 additions and 8 deletions
12
README.md
12
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.
|
||||
|
|
|
@ -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"]
|
||||
- /opt/containers/mailu/dav/collection-root:/dav:ro
|
Loading…
Reference in a new issue