53 lines
2.1 KiB
Docker
53 lines
2.1 KiB
Docker
FROM rust:1.36-slim AS riffol_build
|
|
|
|
RUN cargo install --git https://github.com/shimunn/riffol.git --branch print_error --locked
|
|
|
|
FROM nginx:mainline
|
|
|
|
VOLUME /opt/seafile
|
|
|
|
EXPOSE 80 10001 12001 8000 8080 8082
|
|
|
|
ENV SEAF=/opt/seafile
|
|
|
|
COPY requirements.txt /tmp/requirements.txt
|
|
|
|
RUN apt update && apt install locales -y && apt install -y procps libmariadb-dev-compat openssl python2.7 sqlite3 python-mysqldb python-pil curl libjansson4 libfuse2 python-pip python-pip-whl python-setuptools python3 sqlite3 python3 python3-pip python3-setuptools python3-ldap \
|
|
&& rm -rf /var/lib/apt/lists/* /tmp/requirements.txt
|
|
|
|
RUN python3 -m pip install --upgrade pip && rm -r /root/.cache/pip
|
|
|
|
RUN pip3 install --timeout=3600 click termcolor colorlog pymysql \
|
|
django==1.11.29 && rm -r /root/.cache/pip
|
|
|
|
ADD https://raw.githubusercontent.com/haiwen/seahub/master/requirements.txt /tmp/hub-requirements.txt
|
|
|
|
RUN pip3 install --timeout=3600 -r /tmp/hub-requirements.txt
|
|
|
|
ADD https://raw.githubusercontent.com/haiwen/seafdav/master/requirements.txt /tmp/dav-requirements.txt
|
|
|
|
RUN pip3 install --timeout=3600 -r /tmp/dav-requirements.txt
|
|
|
|
COPY --from=riffol_build /usr/local/cargo/bin/riffol /usr/sbin/
|
|
|
|
RUN ln -s /opt/seafile/seafile-server-latest/seafile.sh /usr/bin/seafile && \
|
|
ln -s /opt/seafile/seafile-server-latest/seahub.sh /usr/bin/seahub && \
|
|
ln -s /opt/seafile/pids /var/run/seafile
|
|
|
|
COPY riffol.conf /etc/riffol.conf
|
|
|
|
COPY conf /opt/seafile/conf
|
|
COPY conf /etc/seafile
|
|
COPY nginx /etc/nginx
|
|
COPY scripts/upgrade.py /usr/local/sbin/upgrade
|
|
COPY scripts/setup.sh /usr/bin/setup
|
|
|
|
RUN ulimit -n 30000 && mkdir -p $SEAF/pids && \
|
|
chmod +x /usr/local/sbin/upgrade /usr/bin/setup
|
|
|
|
ENV SEAF_UPGRADE_INTERVAL=3
|
|
|
|
HEALTHCHECK --interval=30s --timeout=30s --start-period=30s CMD (curl http://localhost:8000 || (echo "failed seahub"; exit 1)) && (curl http://localhost:8082 || (echo "failed seafhttp"; exit 1)) && (bash -c '[ $(curl --silent --output /dev/null --write-out "%{http_code}" http://localhost:8080) -eq 401 ]' || (echo "failed seafdav"; exit 1)) || exit 1
|
|
|
|
ENTRYPOINT ["/usr/sbin/riffol", "-f", "/etc/riffol.conf"]
|