diff --git a/seafile-server/Dockerfile b/seafile-server/Dockerfile index 6876527..6cc548a 100644 --- a/seafile-server/Dockerfile +++ b/seafile-server/Dockerfile @@ -31,6 +31,11 @@ COPY scripts /scripts RUN chmod u+x /scripts/* COPY --from=get /tmp/seafile-server-${SEAFILE_VERSION} /opt/seafile/seafile-server-${SEAFILE_VERSION} +RUN mkdir -p /opt/seafile/logs &&\ +ln -sf /dev/stdout /opt/seafile/logs/seafile.log &&\ +ln -sf /dev/stdout /opt/seafile/logs/controller.log &&\ +ln -sf /dev/stdout /opt/seafile/logs/ccnet.log + EXPOSE 8080 8082 8001 CMD ["/scripts/start.sh"] diff --git a/seafile-server/scripts/create_data_links.sh b/seafile-server/scripts/create_data_links.sh index 464ad33..1346dd3 100644 --- a/seafile-server/scripts/create_data_links.sh +++ b/seafile-server/scripts/create_data_links.sh @@ -35,13 +35,11 @@ for d in ${dirs[*]}; do done if [[ -e /shared/logs/seafile ]]; then - mv /shared/logs/seafile /shared/seafile/logs - rm -rf /opt/seafile/logs && ln -sf /shared/seafile/logs /opt/seafile/ -else - mkdir -p /shared/seafile/logs && ln -sf /shared/seafile/logs /opt/seafile/ + rm -rf /shared/logs/seafile /shared/seafile/logs fi - -if [[ ! -e /shared/logs/var-log ]]; then - mkdir -p /shared/logs/ && mv /var/log /shared/logs/var-log +if [[ -e /shared/seafile/logs ]]; then + rm -rf /shared/seafile/logs +fi +if [[ -e /shared/logs/var-log ]]; then + rm -rf /shared/logs/var-log fi -rm -rf /var/log && ln -sf /shared/logs/var-log /var/log diff --git a/seafile-server/scripts/start.sh b/seafile-server/scripts/start.sh index e285992..ed38185 100644 --- a/seafile-server/scripts/start.sh +++ b/seafile-server/scripts/start.sh @@ -9,4 +9,4 @@ while [ ! -S /opt/seafile/seafile-server-latest/runtime/seafile.sock ]; do sleep 1 done -socat -v -d -d -d TCP-LISTEN:8001,fork,reuseaddr UNIX:/opt/seafile/seafile-server-latest/runtime/seafile.sock,forever,keepalive \ No newline at end of file +socat -d -d TCP-LISTEN:8001,fork,reuseaddr UNIX:/opt/seafile/seafile-server-latest/runtime/seafile.sock,forever,keepalive \ No newline at end of file diff --git a/seahub/Dockerfile b/seahub/Dockerfile index f8da90c..8d3b7c5 100644 --- a/seahub/Dockerfile +++ b/seahub/Dockerfile @@ -79,6 +79,9 @@ ENV SEAFILE_CONF_DIR=/opt/seafile/seafile-data ENV SEAFILE_CENTRAL_CONF_DIR=/opt/seafile/conf ENV SEAFILE_RPC_PIPE_PATH=/opt/seafile/seafile-server-latest/runtime +RUN mkdir -p /opt/seafile/logs &&\ +ln -sf /dev/stdout /opt/seafile/logs/seahub.log + EXPOSE 8000 CMD ["/scripts/start.sh"] \ No newline at end of file diff --git a/seahub/scripts/create_data_links.sh b/seahub/scripts/create_data_links.sh index 464ad33..04ff77a 100644 --- a/seahub/scripts/create_data_links.sh +++ b/seahub/scripts/create_data_links.sh @@ -33,15 +33,3 @@ for d in ${dirs[*]}; do rm -rf /opt/seafile/$d && ln -sf $src /opt/seafile fi done - -if [[ -e /shared/logs/seafile ]]; then - mv /shared/logs/seafile /shared/seafile/logs - rm -rf /opt/seafile/logs && ln -sf /shared/seafile/logs /opt/seafile/ -else - mkdir -p /shared/seafile/logs && ln -sf /shared/seafile/logs /opt/seafile/ -fi - -if [[ ! -e /shared/logs/var-log ]]; then - mkdir -p /shared/logs/ && mv /var/log /shared/logs/var-log -fi -rm -rf /var/log && ln -sf /shared/logs/var-log /var/log diff --git a/seahub/scripts/start.sh b/seahub/scripts/start.sh index 2b53a67..620c45c 100644 --- a/seahub/scripts/start.sh +++ b/seahub/scripts/start.sh @@ -3,7 +3,7 @@ /scripts/create_data_links.sh mkdir -p /opt/seafile/seafile-server-latest/runtime -socat -v -d -d -d UNIX-LISTEN:/opt/seafile/seafile-server-latest/runtime/seafile.sock,fork TCP:seafile-server:8001,forever,keepalive & +socat -d -d UNIX-LISTEN:/opt/seafile/seafile-server-latest/runtime/seafile.sock,fork TCP:seafile-server:8001,forever,keepalive & python3 /opt/seafile/seafile-server-latest/seahub/manage.py runserver 0.0.0.0:8000