Skip to content

Commit

Permalink
Build prod version of configurator
Browse files Browse the repository at this point in the history
  • Loading branch information
unkhz committed Aug 5, 2024
1 parent 8c83de6 commit 8528d7c
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 9 deletions.
6 changes: 5 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
node_modules
dist
node_modules.bun
dist
build
.cache
.khz-k3s
Binary file modified bun.lockb
Binary file not shown.
23 changes: 20 additions & 3 deletions packages/configurator/Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
CMD ["npx", "remix-serve", "build/server/index.js"]
6 changes: 6 additions & 0 deletions packages/configurator/Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
10 changes: 5 additions & 5 deletions packages/configurator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 8528d7c

Please sign in to comment.