Containerise socket server
See https://github.com/excalidraw/excalidraw/issues/1772#issuecomment-652043326
This commit is contained in:
parent
30ca342490
commit
0e1c9cb583
14
Dockerfile
Normal file
14
Dockerfile
Normal file
@ -0,0 +1,14 @@
|
||||
FROM node:14-alpine
|
||||
|
||||
WORKDIR /excalidraw-room
|
||||
|
||||
COPY package.json yarn.lock ./
|
||||
COPY scripts ./scripts
|
||||
RUN SKIP_YARN_POSTINSTALL=true yarn
|
||||
|
||||
COPY tsconfig.json ./
|
||||
COPY src ./src
|
||||
RUN yarn build
|
||||
|
||||
EXPOSE 80
|
||||
CMD ["yarn", "start"]
|
@ -7,7 +7,7 @@
|
||||
"build": "tsc",
|
||||
"fix": "yarn prettier --write",
|
||||
"lint": "yarn prettier --list-different",
|
||||
"postinstall": "npm run build",
|
||||
"postinstall": "node scripts/postinstall.js",
|
||||
"prettier": "prettier \"**/*.{ts,md,json,yaml,yml}\"",
|
||||
"start": "node dist/index.js",
|
||||
"test": "yarn lint"
|
||||
@ -40,6 +40,9 @@
|
||||
"typescript": "3.9.5"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"env": {
|
||||
"es6": true
|
||||
},
|
||||
"extends": [
|
||||
"prettier"
|
||||
],
|
||||
|
9
scripts/postinstall.js
Normal file
9
scripts/postinstall.js
Normal file
@ -0,0 +1,9 @@
|
||||
// There doesn't appear to be a way to skip `postinstall`,
|
||||
// as doing `yarn --ignore-scripts` could prevent native packages from building:
|
||||
// https://github.com/yarnpkg/yarn/issues/4100
|
||||
|
||||
const { execSync } = require("child_process");
|
||||
|
||||
if (process.env.SKIP_YARN_POSTINSTALL !== "true") {
|
||||
execSync("yarnpkg build", { stdio: "inherit" });
|
||||
}
|
@ -12,5 +12,6 @@
|
||||
"resolveJsonModule": true,
|
||||
"isolatedModules": true,
|
||||
"outDir": "dist"
|
||||
}
|
||||
},
|
||||
"include": ["src/**/*"]
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user