diff --git a/docker/Dockerfile b/docker/Dockerfile index 2d41090..8a3c8e4 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,14 +1,14 @@ FROM node:20.11.1-alpine AS server-builder RUN apk add --no-cache git git-lfs && \ - git clone -b master --depth=1 https://github.com/AirryCo/spt-server.git /spt-server && \ - cd /spt-server && git lfs pull && \ + git clone -b master --depth=1 https://github.com/AirryCo/spt-server.git /snapshot && \ + cd /snapshot && git lfs pull && \ cd project && \ npm install && npm run build:release FROM debian:bookworm-slim LABEL author="AirryCo " ENV TZ=Asia/Shanghai -COPY --from=server-builder /spt-server/project/build/ /app/spt-server/ +COPY --from=server-builder /snapshot/project/build/ /app/spt-server/ VOLUME /opt/spt-server WORKDIR /opt/spt-server EXPOSE 6969 diff --git a/docker/Dockerfile-fika b/docker/Dockerfile-fika index ba9c2de..70bc236 100644 --- a/docker/Dockerfile-fika +++ b/docker/Dockerfile-fika @@ -7,15 +7,15 @@ RUN apk add --no-cache git unzip && \ FROM node:20.11.1-alpine AS server-builder RUN apk add --no-cache git git-lfs && \ - git clone -b 3.10.0-DEV --depth=1 https://github.com/AirryCo/spt-server.git /spt-server && \ - cd /spt-server && git lfs pull && \ + git clone -b 3.10.0-DEV --depth=1 https://github.com/AirryCo/spt-server.git /snapshot && \ + cd /snapshot && git lfs pull && \ cd project && \ npm install && npm run build:release FROM debian:bookworm-slim LABEL author="AirryCo " ENV TZ=Asia/Shanghai -COPY --from=server-builder /spt-server/project/build/ /app/spt-server/ +COPY --from=server-builder /snapshot/project/build/ /app/spt-server/ COPY --from=fika-builder /fika-server/output/ /app/spt-server/ VOLUME /opt/spt-server WORKDIR /opt/spt-server diff --git a/docker/Dockerfile-nightly b/docker/Dockerfile-nightly index 69205ab..54f90ce 100644 --- a/docker/Dockerfile-nightly +++ b/docker/Dockerfile-nightly @@ -1,14 +1,14 @@ FROM node:20.11.1-alpine AS server-builder RUN apk add --no-cache git git-lfs && \ - git clone -b 3.10.0-DEV --depth=1 https://github.com/AirryCo/spt-server.git /spt-server && \ - cd /spt-server && git lfs pull && \ + git clone -b 3.10.0-DEV --depth=1 https://github.com/AirryCo/spt-server.git /snapshot && \ + cd /snapshot && git lfs pull && \ cd project && \ npm install && npm run build:release FROM debian:bookworm-slim LABEL author="AirryCo " ENV TZ=Asia/Shanghai -COPY --from=server-builder /spt-server/project/build/ /app/spt-server/ +COPY --from=server-builder /snapshot/project/build/ /app/spt-server/ VOLUME /opt/spt-server WORKDIR /opt/spt-server EXPOSE 6969 diff --git a/docker/Dockerfile-nightly-fika b/docker/Dockerfile-nightly-fika index 1434deb..a3e5625 100644 --- a/docker/Dockerfile-nightly-fika +++ b/docker/Dockerfile-nightly-fika @@ -7,15 +7,15 @@ RUN apk add --no-cache git unzip && \ FROM node:20.11.1-alpine AS server-builder RUN apk add --no-cache git git-lfs && \ - git clone -b 3.10.0-DEV --depth=1 https://github.com/AirryCo/spt-server.git /spt-server && \ - cd /spt-server && git lfs pull && \ + git clone -b 3.10.0-DEV --depth=1 https://github.com/AirryCo/spt-server.git /snapshot && \ + cd /snapshot && git lfs pull && \ cd project && \ npm install && npm run build:release FROM debian:bookworm-slim LABEL author="AirryCo " ENV TZ=Asia/Shanghai -COPY --from=server-builder /spt-server/project/build/ /app/spt-server/ +COPY --from=server-builder /snapshot/project/build/ /app/spt-server/ COPY --from=fika-builder /fika-server/output/ /app/spt-server/ VOLUME /opt/spt-server WORKDIR /opt/spt-server diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index 41e9651..c5294cc 100644 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -2,8 +2,8 @@ if [ -f /opt/spt-server/SPT.Server ]; then appHash=$(md5sum /app/spt-server/SPT.Server | awk '{ print $1 }') - optHash=$(md5sum /opt/spt-server/SPT.Server | awk '{ print $1 }') - if [ "$appHash" = "$optHash" ]; then + exeHash=$(md5sum /opt/spt-server/SPT.Server | awk '{ print $1 }') + if [ "$appHash" = "$exeHash" ]; then echo "MD5 verification successful!" else echo "MD5 mismatch, copy files to /opt/spt-server."