Skip to content

Commit 1a789b5

Browse files
Logging to console
Logging to console instead of a file to make it easier to peek into the container and see the status.
1 parent 84ff1e2 commit 1a789b5

File tree

4 files changed

+40
-4
lines changed

4 files changed

+40
-4
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Docker Image CI
1+
name: Docker Build Dev - Latest
22

33
on:
44
push:

.github/workflows/docker-prod.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Docker Build Prod - Stable
2+
3+
on:
4+
push:
5+
branches-ignore:
6+
- "master"
7+
pull_request:
8+
branches-ignore:
9+
- "master"
10+
11+
jobs:
12+
13+
build:
14+
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
-
19+
name: Login to DockerHub
20+
uses: docker/login-action@v2
21+
with:
22+
username: ${{ secrets.DOCKERHUB_USERNAME }}
23+
password: ${{ secrets.DOCKERHUB_TOKEN }}
24+
25+
-
26+
name: Build and push
27+
uses: docker/build-push-action@v3
28+
with:
29+
push: true
30+
tags: themranderson/afraidorgupdater:stable

Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
FROM alpine:latest
22

3+
RUN apk add --no-cache bash curl cronie
4+
35
ADD ./entrypoint.sh /entrypoint.sh
46
RUN chmod +x /entrypoint.sh
57

entrypoint.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
#!/bin/sh
22

3-
crontab -l | { cat; echo "PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin"; } | crontab -
4-
crontab -l | { cat; echo "*/5 * * * * sleep 9 ; curl -s http://sync.afraid.org/u/$1/ >> /tmp/freedns_domain.log 2>/dev/null"; } | crontab -
3+
# Ensure /root/.cache exists for crontab
4+
mkdir -p /root/.cache
55

6-
crond -f -l 0
6+
(crontab -l 2>/dev/null; echo "PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin") | crontab -
7+
(crontab -l 2>/dev/null; echo "*/5 * * * * sleep 9 ; curl -s http://sync.afraid.org/u/$1/ >> /proc/1/fd/1 2>&1") | crontab -
8+
9+
# Start crond in foreground
10+
crond -f

0 commit comments

Comments
 (0)