update Dockerfile.

This commit is contained in:
AirryCo
2024-11-28 18:25:30 +08:00
parent ebbd53106f
commit 1ee6e90501
5 changed files with 14 additions and 14 deletions

View File

@@ -1,14 +1,14 @@
FROM node:20.11.1-alpine AS server-builder FROM node:20.11.1-alpine AS server-builder
RUN apk add --no-cache git git-lfs && \ RUN apk add --no-cache git git-lfs && \
git clone -b master --depth=1 https://github.com/AirryCo/spt-server.git /spt-server && \ git clone -b master --depth=1 https://github.com/AirryCo/spt-server.git /snapshot && \
cd /spt-server && git lfs pull && \ cd /snapshot && git lfs pull && \
cd project && \ cd project && \
npm install && npm run build:release npm install && npm run build:release
FROM debian:bookworm-slim FROM debian:bookworm-slim
LABEL author="AirryCo <henry@stblog.com.cn>" LABEL author="AirryCo <henry@stblog.com.cn>"
ENV TZ=Asia/Shanghai 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 VOLUME /opt/spt-server
WORKDIR /opt/spt-server WORKDIR /opt/spt-server
EXPOSE 6969 EXPOSE 6969

View File

@@ -7,15 +7,15 @@ RUN apk add --no-cache git unzip && \
FROM node:20.11.1-alpine AS server-builder FROM node:20.11.1-alpine AS server-builder
RUN apk add --no-cache git git-lfs && \ 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 && \ git clone -b 3.10.0-DEV --depth=1 https://github.com/AirryCo/spt-server.git /snapshot && \
cd /spt-server && git lfs pull && \ cd /snapshot && git lfs pull && \
cd project && \ cd project && \
npm install && npm run build:release npm install && npm run build:release
FROM debian:bookworm-slim FROM debian:bookworm-slim
LABEL author="AirryCo <henry@stblog.com.cn>" LABEL author="AirryCo <henry@stblog.com.cn>"
ENV TZ=Asia/Shanghai 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/ COPY --from=fika-builder /fika-server/output/ /app/spt-server/
VOLUME /opt/spt-server VOLUME /opt/spt-server
WORKDIR /opt/spt-server WORKDIR /opt/spt-server

View File

@@ -1,14 +1,14 @@
FROM node:20.11.1-alpine AS server-builder FROM node:20.11.1-alpine AS server-builder
RUN apk add --no-cache git git-lfs && \ 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 && \ git clone -b 3.10.0-DEV --depth=1 https://github.com/AirryCo/spt-server.git /snapshot && \
cd /spt-server && git lfs pull && \ cd /snapshot && git lfs pull && \
cd project && \ cd project && \
npm install && npm run build:release npm install && npm run build:release
FROM debian:bookworm-slim FROM debian:bookworm-slim
LABEL author="AirryCo <henry@stblog.com.cn>" LABEL author="AirryCo <henry@stblog.com.cn>"
ENV TZ=Asia/Shanghai 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 VOLUME /opt/spt-server
WORKDIR /opt/spt-server WORKDIR /opt/spt-server
EXPOSE 6969 EXPOSE 6969

View File

@@ -7,15 +7,15 @@ RUN apk add --no-cache git unzip && \
FROM node:20.11.1-alpine AS server-builder FROM node:20.11.1-alpine AS server-builder
RUN apk add --no-cache git git-lfs && \ 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 && \ git clone -b 3.10.0-DEV --depth=1 https://github.com/AirryCo/spt-server.git /snapshot && \
cd /spt-server && git lfs pull && \ cd /snapshot && git lfs pull && \
cd project && \ cd project && \
npm install && npm run build:release npm install && npm run build:release
FROM debian:bookworm-slim FROM debian:bookworm-slim
LABEL author="AirryCo <henry@stblog.com.cn>" LABEL author="AirryCo <henry@stblog.com.cn>"
ENV TZ=Asia/Shanghai 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/ COPY --from=fika-builder /fika-server/output/ /app/spt-server/
VOLUME /opt/spt-server VOLUME /opt/spt-server
WORKDIR /opt/spt-server WORKDIR /opt/spt-server

View File

@@ -2,8 +2,8 @@
if [ -f /opt/spt-server/SPT.Server ]; then if [ -f /opt/spt-server/SPT.Server ]; then
appHash=$(md5sum /app/spt-server/SPT.Server | awk '{ print $1 }') appHash=$(md5sum /app/spt-server/SPT.Server | awk '{ print $1 }')
optHash=$(md5sum /opt/spt-server/SPT.Server | awk '{ print $1 }') exeHash=$(md5sum /opt/spt-server/SPT.Server | awk '{ print $1 }')
if [ "$appHash" = "$optHash" ]; then if [ "$appHash" = "$exeHash" ]; then
echo "MD5 verification successful!" echo "MD5 verification successful!"
else else
echo "MD5 mismatch, copy files to /opt/spt-server." echo "MD5 mismatch, copy files to /opt/spt-server."