diff --git a/.dockerignore b/.dockerignore index 76add87..7953c4b 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,2 +1,6 @@ node_modules -dist \ No newline at end of file +node_modules.bun +dist +build +.cache +.khz-k3s \ No newline at end of file diff --git a/bun.lockb b/bun.lockb index a3cb346..2bd1ce4 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/packages/configurator/Dockerfile b/packages/configurator/Dockerfile index 7353f69..2ac4618 100644 --- a/packages/configurator/Dockerfile +++ b/packages/configurator/Dockerfile @@ -1,9 +1,26 @@ -FROM ghcr.io/unkhz/ruuvipuserrin-base-bun +FROM ghcr.io/unkhz/ruuvipuserrin-base-bun AS build WORKDIR /app +# Install dev deps for build +RUN bun install --frozen-lockfile + +WORKDIR /app/packages/configurator + +RUN bun x remix vite:build + +######################################### +FROM node:20-alpine + +WORKDIR /app + +COPY --link --from=ghcr.io/unkhz/ruuvipuserrin-base-bun /app/node_modules ./node_modules +COPY --link --from=build /app/packages/configurator/build ./build + +WORKDIR /app/packages/configurator + EXPOSE 3000 -ENV PORT 3000 +ENV PORT=3000 -CMD ["bun", "x", "@remix-run/serve", "packages/configurator/build/server/index.js"] \ No newline at end of file +CMD ["npx", "remix-serve", "build/server/index.js"] \ No newline at end of file diff --git a/packages/configurator/Taskfile.yml b/packages/configurator/Taskfile.yml index 57feaec..23fd9da 100644 --- a/packages/configurator/Taskfile.yml +++ b/packages/configurator/Taskfile.yml @@ -12,6 +12,12 @@ tasks: cmds: - bun x remix vite:dev + serve: + desc: Run in development mode + cmds: + # Can't run with bun yet, see https://github.com/remix-run/remix/discussions/7413 + - npx remix-serve build/server/index.js + lint: desc: Run ESLint cmds: diff --git a/packages/configurator/package.json b/packages/configurator/package.json index c6923eb..facafe8 100644 --- a/packages/configurator/package.json +++ b/packages/configurator/package.json @@ -5,17 +5,17 @@ "type": "module", "dependencies": { "@ruuvipuserrin/common-archive-client": "workspace:*", - "@remix-run/node": "^2.10.3", - "@remix-run/react": "^2.10.3", - "@remix-run/serve": "^2.10.3", + "@remix-run/node": "^2.11.0", + "@remix-run/react": "^2.11.0", + "@remix-run/serve": "^2.11.0", "cross-env": "^7.0.3", "daisyui": "^2.50.2", "react": "^18.2.0", "react-dom": "^18.2.0" }, "devDependencies": { - "@remix-run/dev": "^2.10.3", - "@remix-run/eslint-config": "^2.10.3", + "@remix-run/dev": "^2.11.0", + "@remix-run/eslint-config": "^2.11.0", "@types/react": "^18.3.3", "@types/react-dom": "^18.3.0", "eslint": "^8.27.0",