Skip to content

Commit

Permalink
Create copydone file to make sure the copy is done
Browse files Browse the repository at this point in the history
  • Loading branch information
Doridian committed Mar 29, 2024
1 parent b121ebb commit d77d926
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 21 deletions.
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
__pycache__
*.pyc
.copydone
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
__pycache__
*.pyc
.copydone
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ ENV SPACEAGE_SERVER_TOKEN=dummy

COPY . /opt/StarLord

ENTRYPOINT ["/opt/StarLord/dockerboot.sh"]
ENTRYPOINT ["/opt/StarLord/misc/dockerboot.sh"]
20 changes: 0 additions & 20 deletions dockerboot.sh

This file was deleted.

21 changes: 21 additions & 0 deletions misc/dockerboot.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/sh
set -ex

SERVER_DIR="${HOME}"
STARLORD_DIR="${SERVER_DIR}/StarLord"
STARLORD_COPY_DONE_FILE="${STARLORD_DIR}/.copydone"

if [ -f "${STARLORD_COPY_DONE_FILE}" ]; then
exec /usr/bin/python3 "${STARLORD_DIR}"
exit 1
fi

if [ -d "${STARLORD_DIR}" ]; then
rm -rf "${STARLORD_DIR}"
fi

cp -r /opt/StarLord "${STARLORD_DIR}"
touch "${STARLORD_COPY_DONE_FILE}"

exec /usr/bin/python3 "${STARLORD_DIR}"
exit 1

0 comments on commit d77d926

Please sign in to comment.