diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..c8dbc49 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,2 @@ +.git/ +node_modules/ diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..cc6cbfb --- /dev/null +++ b/Dockerfile @@ -0,0 +1,17 @@ +FROM oven/bun:debian + +RUN apt update +RUN apt install -y openjdk-17-jdk + +USER bun + +WORKDIR /opt/server +COPY --chown=bun:bun . . + +WORKDIR /opt/server/engine +RUN bun install +RUN bun run build + +WORKDIR /opt/server/engine +EXPOSE 8888/tcp +ENTRYPOINT [ "bun", "run", "quickstart" ] diff --git a/start.bat b/start.bat index 35c343e..3ecda5c 100644 --- a/start.bat +++ b/start.bat @@ -6,21 +6,18 @@ if errorlevel 1 ( exit /b ) -where /q node -if errorlevel 1 ( - echo You must install Node to proceed: https://nodejs.org/en - exit /b -) - where /q bun if errorlevel 1 ( - npm i -g bun -) + where /q node + if errorlevel 0 ( + npm i -g bun + ) -where /q bun -if errorlevel 1 ( - echo You must install Bun to proceed: https://bun.sh - exit /b + where /q bun + if errorlevel 1 ( + echo You must install Bun to proceed: https://bun.sh + exit /b + ) ) where /q java diff --git a/start.sh b/start.sh index 314b753..adc8505 100755 --- a/start.sh +++ b/start.sh @@ -5,15 +5,6 @@ if ! command -v git 2>&1 >/dev/null; then exit 1 fi -if ! command -v node 2>&1 >/dev/null; then - echo You must install Node to proceed - exit 1 -fi - -if ! command -v bun 2>&1 >/dev/null; then - npm i -g bun -fi - if ! command -v bun 2>&1 >/dev/null; then echo You must install Bun to proceed exit 1