add new DockerFile and docker-compose example

This commit is contained in:
hxsf
2020-07-24 13:36:33 +08:00
parent 6578397ee3
commit 6c06d9fb6a
4 changed files with 130 additions and 3 deletions

View File

@@ -1,3 +1,14 @@
FROM php:7.4-fpm
EXPOSE 9000
WORKDIR /var/www
FROM composer:1.10.9
ENV TZ Asia/Shanghai
ENV cron="0 */1 * * *"
COPY . /IYUU
COPY ./docker/entrypoint.sh /entrypoint.sh
WORKDIR /IYUU
RUN apk add --no-cache bash tzdata \
&& composer i
ENTRYPOINT [ "/entrypoint.sh" ]

View File

@@ -0,0 +1,11 @@
version: "2.3"
services:
app:
image: hxsf/iyuuautoreseed
network_mode: host
environment:
- cron=0 * * * *
volumes:
- ./config:/IYUU/config
- ./torrent:/IYUU/torrent
restart: always

10
docker/entrypoint.sh Executable file
View File

@@ -0,0 +1,10 @@
#!/bin/bash
DEFAULT_CRON="0 */1 * * *"
cron=${cron:-$DEFAULT_CRON}
set -e
echo "$cron /usr/local/bin/php /IYUU/iyuu.php" | crontab -
/usr/local/bin/php /IYUU/iyuu.php
/usr/sbin/crond -f