Skip to content

Commit a2820af

Browse files
committed
update documentation
1 parent 2de3290 commit a2820af

1 file changed

Lines changed: 21 additions & 26 deletions

File tree

README.md

Lines changed: 21 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -30,50 +30,45 @@ To run your cron jobs, **you must mount your `crontab` file** to the `/etc/cront
3030
Here is an example of a `docker-compose.yml` file:
3131

3232
```yaml
33-
version: '3.8'
34-
3533
services:
3634
cron-worker:
3735
image: ghcr.io/codesyntax/docker-cron-image:latest
38-
container_name: my-cron-job
36+
container_name: cron-worker
3937
restart: unless-stopped
4038
volumes:
41-
# Mount the file with your cron jobs (overwrite)
42-
- ./my-crontab.txt:/crontab.txt:ro
43-
44-
# Mount the Docker socket (to use Docker commands)
39+
- ./crontab.txt:/crontab.txt:ro
4540
- /var/run/docker.sock:/var/run/docker.sock
4641
```
4742
48-
### ⚠️ Ohar garrantzitsuak konfigurazioari buruz
43+
### ⚠️ Important configuration notes
4944
50-
Zure `crontab.txt` fitxategia sortzean, kontuan izan hiru puntu hauek:
45+
When creating your `crontab.txt` file, keep these three points in mind:
5146

52-
1. **Irteera desbideratu:** Docker-ek logak irakurri ahal izateko, komandoen irteera `/proc/1/fd/1`-era bideratu behar da.
53-
2. **Lerro hutsa:** Fitxategiaren amaieran beti lerro huts bat utzi (bestela cron-ek ez du irakurriko).
54-
3. **Docker Socket-a:** `docker-compose` fitxategian `/var/run/docker.sock` muntatzea ezinbestekoa da zure cron lanek `docker` komandoak exekutatu behar badituzte (adibidez: `docker restart nginx`). Honek edukiontziari baimena ematen dio "Host" makinako Docker motorra kontrolatzeko.
47+
1. **Redirect output:** In order for Docker to read the logs, command output must be redirected to `/proc/1/fd/1`.
48+
2. **Empty line:** Always leave an empty line at the end of the file (otherwise cron will not read it).
49+
3. **Docker Socket:** Mounting `/var/run/docker.sock` in the `docker-compose` file is essential if your cron jobs need to execute `docker` commands (e.g., `docker restart nginx`). This grants the container permission to control the Host machine's Docker engine.
5550

56-
Adibidea (`crontab.txt`):
51+
Example (`crontab.txt`):
5752
```text
58-
# Adibidea: Nginx edukiontzia berrabiarazi egunero 03:00etan
59-
0 3 * * * docker restart nire-nginx > /proc/1/fd/1 2>&1
53+
# Example: Restart Nginx container every day at 03:00
54+
0 3 * * * docker restart my-nginx > /proc/1/fd/1 2>&1
6055
```
6156

62-
## Garapen gida
57+
## Development Guide
6358

64-
Proiektu honek **CI/CD** (Continuous Integration / Continuous Deployment) sistema bat du integratuta GitHub Actions erabiliz.
59+
This project features an integrated **CI/CD** (Continuous Integration / Continuous Deployment) system using GitHub Actions.
6560

66-
### GitHub Actions Workflow-a
61+
### GitHub Actions Workflow
6762

68-
Errepositorioan aldaketak egiten diren bakoitzean, `.github/workflows/docker-publish.yml` fitxategian definitutako prozesua abiarazten da.
63+
Whenever changes are made to the repository, the process defined in the `.github/workflows/docker-publish.yml` file is triggered.
6964

70-
Workflow honen urratsak honako hauek dira:
65+
The steps of this workflow are as follows:
7166

72-
1. **Aktibazioa:** `main` adarrera *push* bat egiten denean aktibatzen da automatikoki.
73-
2. **Build:** Docker irudia eraikitzen du `Dockerfile` erabiliz.
74-
3. **Tagging:** Irudiari bi etiketa jartzen dizkio:
67+
1. **Trigger:** Automatically activated when a *push* is made to the `main` branch.
68+
2. **Build:** Builds the Docker image using the `Dockerfile`.
69+
3. **Tagging:** Applies two tags to the image:
7570
* `latest`
76-
* Data eta commit hash-a daraman etiketa bakarra.
77-
4. **Publish:** Irudia **GitHub Container Registry (GHCR)**-ra igotzen du.
71+
* A unique tag containing the date and commit hash.
72+
4. **Publish:** Uploads the image to the **GitHub Container Registry (GHCR)**.
7873

79-
Ez da eskuzko `docker push` komandorik behar; kodea igotzearekin batera irudiaren bertsio berria eskuragarri egongo da minutu gutxiren buruan.
74+
No manual `docker push` command is required; simply pushing the code will make the new version of the image available within a few minutes.

0 commit comments

Comments
 (0)