Skip to content

Commit

Permalink
fix: 🐛 添加默认db
Browse files Browse the repository at this point in the history
  • Loading branch information
monlor committed Feb 7, 2024
1 parent 329ebbe commit 2529392
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
13 changes: 8 additions & 5 deletions forwardpanel/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,21 @@ FROM beginner202010/forwordpanel:1.0.7-SNAPSHOT as source
FROM amazoncorretto:8u402

LABEL MAINTAINER [email protected]
LABEL VERSION 1.0.2
LABEL VERSION 1.0.3

ENV LANG=C.UTF-8

VOLUME /data

WORKDIR /app

COPY application.properties /app/
COPY --from=source /forward_db* /data/
COPY --from=source /forward_db* /app/
COPY --from=source app.jar /app/

RUN mkdir /config
COPY application.properties /app/

COPY entrypoint.sh /

RUN mkdir /config && chmod +x /entrypoint.sh

Entrypoint [ "/usr/bin/java", "-jar", "/app/app.jar" ]
Entrypoint [ "/entrypoint.sh" ]
13 changes: 13 additions & 0 deletions forwardpanel/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/sh

if [ ! -f /data/forward_db.mv.db ]; then
mv -f /app/forward_db.mv.db /data/forward_db.mv.db
fi

if [ ! -f /data/forward_db.trace.db ]; then
mv -f /app/forward_db.trace.db /data/forward_db.trace.db
fi

echo "默认账号:admin,默认密码:XIAOLIzz123"

/usr/bin/java -jar /app/app.jar

0 comments on commit 2529392

Please sign in to comment.