Skip to content

Commit ecf366d

Browse files
committed
Fix cron CMD
1 parent 2c7c723 commit ecf366d

File tree

3 files changed

+16
-9
lines changed

3 files changed

+16
-9
lines changed

Docker/Dockerfile

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,9 @@ COPY ./Docker/*.Apache.conf /etc/apache2/conf.d/
1818
RUN echo "17,37 * * * * php ${FRESHRSS_ROOT}/app/actualize_script.php 2>&1 | tee /tmp/FreshRSS.log" >> \
1919
/var/spool/cron/crontabs/root
2020

21-
EXPOSE 80
2221
ENV CRON_MIN ''
23-
CMD php -f ./cli/prepare.php > /dev/null && \
24-
chown -R :www-data ${FRESHRSS_ROOT} && \
25-
chmod -R g+r ${FRESHRSS_ROOT} && chmod -R g+w ${FRESHRSS_ROOT}/data/ && \
26-
([ -z "$CRON_MIN" ] || ( \
27-
sed -r -i "/FreshRSS/s/^[^ ]+ /$CRON_MIN /g" /var/spool/cron/crontabs/root && \
28-
crond -d 6 \
29-
)) && \
22+
ENTRYPOINT ["./Docker/entrypoint.sh"]
23+
24+
EXPOSE 80
25+
CMD ([ -z "$CRON_MIN" ] || crond -d 6) && \
3026
exec httpd -D FOREGROUND

Docker/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,6 @@ See cron option 1 for customising the cron schedule.
130130
sudo docker run -dit --restart unless-stopped --log-opt max-size=10m \
131131
-v $(pwd)/data:/var/www/FreshRSS/data \
132132
-e 'CRON_MIN=17,37' \
133-
-p 8080:80 \
134133
--name freshrss_cron freshrss/freshrss crond -f -d 6
135134
```
136135

Docker/entrypoint.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/sh
2+
3+
php -f ./cli/prepare.php > /dev/null
4+
5+
chown -R :www-data .
6+
chmod -R g+r . && chmod -R g+w ./data/
7+
8+
if [ -n "$CRON_MIN" ]; then
9+
sed -r -i "/FreshRSS/s/^[^ ]+ /$CRON_MIN /g" /var/spool/cron/crontabs/root
10+
fi
11+
12+
exec "$@"

0 commit comments

Comments
 (0)