Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"root": true,
"env": {
"browser": true,
"es2021": true,
"node": true
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": [
"@typescript-eslint"
],
"rules": {
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-unused-vars": ["warn", { "argsIgnorePattern": "^_" }],
"@typescript-eslint/ban-ts-comment": "off"
},
"ignorePatterns": ["dist", "node_modules", "*.html"]
}
25 changes: 17 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,33 @@ COPY packages/server/package.json packages/server/
COPY apps/launcher/package.json apps/launcher/
COPY apps/edocs/package.json apps/edocs/
COPY apps/enotes/package.json apps/enotes/
RUN npm install -g pnpm && pnpm install --workspace=packages/core --workspace=packages/ebot-client --workspace=packages/server --workspace=apps/launcher --workspace=apps/edocs --workspace=apps/enotes

RUN npm install -g pnpm && \
pnpm install --workspace=packages/core --workspace=packages/ebot-client --workspace=packages/server --workspace=apps/launcher --workspace=apps/edocs --workspace=apps/enotes

COPY . .
RUN pnpm run build --filter=@eoffice/core
RUN pnpm run build --filter=@eoffice/ebot-client
RUN pnpm run build --filter=@eoffice/server
RUN pnpm run build --filter=@eoffice/launcher
RUN pnpm run build --filter=@eoffice/edocs
RUN pnpm run build --filter=@eoffice/enotes
RUN pnpm run build --filter=@eoffice/core && \
pnpm run build --filter=@eoffice/ebot-client && \
pnpm run build --filter=@eoffice/server && \
pnpm run build --filter=@eoffice/launcher && \
pnpm run build --filter=@eoffice/edocs && \
pnpm run build --filter=@eoffice/enotes

# Production stage
FROM node:20-alpine AS production
WORKDIR /app
ENV NODE_ENV=production

COPY --from=builder /app/packages/server/dist ./server/
COPY --from=builder /app/apps/launcher/dist ./public/launcher/
COPY --from=builder /app/apps/edocs/dist ./public/edocs/
COPY --from=builder /app/apps/enotes/dist ./public/enotes/
COPY --from=builder /app/packages/server/package.json ./
RUN npm install -g pnpm && pnpm install --prod

RUN npm install -g pnpm && \
pnpm install --prod && \
chown -R node:node /app

USER node
EXPOSE 3001
CMD ["node", "server/index.js"]
3 changes: 2 additions & 1 deletion enterprise/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ LABEL maintainer="embeddedos-org" description="Office Suite — EoS Enterprise"

WORKDIR /app
COPY package*.json ./
RUN npm install -g pnpm && pnpm install --prod
RUN npm install -g pnpm && pnpm install --prod && chown -R node:node /app
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Solid improvements overall: running the container as a non‑root user with proper chown hardens security, combining RUN commands improves layer efficiency and caching, and explicit workspace‑based installs/builds improve determinism and CI stability. Please also test this change locally (on any machine) and attach the test results or logs to the PR.

COPY . .

USER node
EXPOSE 8080
HEALTHCHECK --interval=30s --timeout=5s CMD wget -qO- http://localhost:8080/health || exit 1
CMD ["node", "server.js"]
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"build": "npm run build --workspaces",
"test": "npm run test --workspaces --if-present",
"lint": "eslint . --ext .ts,.tsx --max-warnings 0",
"typecheck": "pnpm -r exec tsc --noEmit",
"clean": "rm -rf node_modules packages/*/dist apps/*/dist"
},
"devDependencies": {
Expand Down
Loading