diff --git a/.github/workflows/publish-docker.yml b/.github/workflows/publish-docker.yml new file mode 100644 index 0000000..77f9bf0 --- /dev/null +++ b/.github/workflows/publish-docker.yml @@ -0,0 +1,20 @@ +name: Publish Docker + +on: + push: + branches: + - master + +jobs: + publish-docker: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - uses: docker/build-push-action@v1 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + repository: excalidraw/excalidraw-room + tag_with_ref: true + tag_with_sha: true diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..06c09cc --- /dev/null +++ b/Dockerfile @@ -0,0 +1,13 @@ +FROM node:12-alpine + +WORKDIR /excalidraw-room + +COPY package.json yarn.lock ./ +RUN yarn + +COPY tsconfig.json ./ +COPY src ./src +RUN yarn build + +EXPOSE 80 +CMD ["yarn", "start"] diff --git a/package.json b/package.json index 7c00d24..a6195e2 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,6 @@ "build": "tsc", "fix": "yarn prettier --write", "lint": "yarn prettier --list-different", - "postinstall": "npm run build", "prettier": "prettier \"**/*.{ts,md,json,yaml,yml}\"", "start": "node dist/index.js", "test": "yarn lint" @@ -26,18 +25,18 @@ "dependencies": { "debug": "4.1.1", "eslint": "7.3.1", - "eslint-config-prettier": "6.11.0", + "eslint-config-prettier": "6.10.1", "eslint-plugin-prettier": "3.1.4", "express": "4.17.1", "prettier": "2.0.5", "socket.io": "2.3.0" }, "devDependencies": { - "@types/socket.io": "2.1.11", + "@types/socket.io": "2.1.4", "@types/debug": "4.1.5", - "@types/express": "4.17.7", + "@types/express": "4.17.6", "@types/node": "13.9.8", - "typescript": "4.0.2" + "typescript": "3.9.5" }, "eslintConfig": { "extends": [ diff --git a/yarn.lock b/yarn.lock index a9749f0..2c5e226 100644 --- a/yarn.lock +++ b/yarn.lock @@ -43,13 +43,6 @@ resolved "https://registry.yarnpkg.com/@types/debug/-/debug-4.1.5.tgz#b14efa8852b7768d898906613c23f688713e02cd" integrity sha512-Q1y515GcOdTHgagaVFhHnIFQ38ygs/kmxdNpvpou+raI9UO3YZcHDngBSYKQklcKlvA7iuQlmIKbzvmxcOE9CQ== -"@types/engine.io@*": - version "3.1.4" - resolved "https://registry.yarnpkg.com/@types/engine.io/-/engine.io-3.1.4.tgz#3d9472711d179daa7c95c051e50ad411e18a9bdc" - integrity sha512-98rXVukLD6/ozrQ2O80NAlWDGA4INg+tqsEReWJldqyi2fulC9V7Use/n28SWgROXKm6003ycWV4gZHoF8GA6w== - dependencies: - "@types/node" "*" - "@types/express-serve-static-core@*": version "4.17.2" resolved "https://registry.yarnpkg.com/@types/express-serve-static-core/-/express-serve-static-core-4.17.2.tgz#f6f41fa35d42e79dbf6610eccbb2637e6008a0cf" @@ -58,10 +51,10 @@ "@types/node" "*" "@types/range-parser" "*" -"@types/express@4.17.7": - version "4.17.7" - resolved "https://registry.yarnpkg.com/@types/express/-/express-4.17.7.tgz#42045be6475636d9801369cd4418ef65cdb0dd59" - integrity sha512-dCOT5lcmV/uC2J9k0rPafATeeyz+99xTt54ReX11/LObZgfzJqZNcW27zGhYyX+9iSEGXGt5qLPwRSvBZcLvtQ== +"@types/express@4.17.6": + version "4.17.6" + resolved "https://registry.yarnpkg.com/@types/express/-/express-4.17.6.tgz#6bce49e49570507b86ea1b07b806f04697fac45e" + integrity sha512-n/mr9tZI83kd4azlPG5y997C/M4DNABK9yErhFM6hKdym4kkmd9j0vtsJyjFIwfRBxtrxZtAfGZCNRIBMFLK5w== dependencies: "@types/body-parser" "*" "@types/express-serve-static-core" "*" @@ -96,12 +89,11 @@ "@types/express-serve-static-core" "*" "@types/mime" "*" -"@types/socket.io@2.1.11": - version "2.1.11" - resolved "https://registry.yarnpkg.com/@types/socket.io/-/socket.io-2.1.11.tgz#e0d6759880e5f9818d5297a3328b36641bae996b" - integrity sha512-bVprmqPhJMLb9ZCm8g0Xy8kwBFRbnanOWSxzWkDkkIwxTvud5tKMfAJymXX6LQbizUKCS1yima7JM4BeLqjNqA== +"@types/socket.io@2.1.4": + version "2.1.4" + resolved "https://registry.yarnpkg.com/@types/socket.io/-/socket.io-2.1.4.tgz#674e7bc193c5ccdadd4433f79f3660d31759e9ac" + integrity sha512-cI98INy7tYnweTsUlp8ocveVdAxENUThO0JsLSCs51cjOP2yV5Mqo5QszMDPckyRRA+PO6+wBgKvGvHUCc23TQ== dependencies: - "@types/engine.io" "*" "@types/node" "*" accepts@~1.3.4, accepts@~1.3.7: @@ -477,10 +469,10 @@ escape-string-regexp@^1.0.5: resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= -eslint-config-prettier@6.11.0: - version "6.11.0" - resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-6.11.0.tgz#f6d2238c1290d01c859a8b5c1f7d352a0b0da8b1" - integrity sha512-oB8cpLWSAjOVFEJhhyMZh6NOEOtBVziaqdDQ86+qhDHFbZXoRTM7pNSvFRfW/W/L/LrQ38C99J5CGuRBBzBsdA== +eslint-config-prettier@6.10.1: + version "6.10.1" + resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-6.10.1.tgz#129ef9ec575d5ddc0e269667bf09defcd898642a" + integrity sha512-svTy6zh1ecQojvpbJSgH3aei/Rt7C6i090l5f2WQ4aB05lYHeZIR1qL4wZyyILTbtmnbHP5Yn8MrsOJMGa8RkQ== dependencies: get-stdin "^6.0.0" @@ -898,9 +890,9 @@ levn@^0.4.1: type-check "~0.4.0" lodash@^4.17.14: - version "4.17.20" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.20.tgz#b44a9b6297bcb698f1c51a3545a2b3b368d59c52" - integrity sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA== + version "4.17.15" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548" + integrity sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A== media-typer@0.3.0: version "0.3.0" @@ -1344,10 +1336,10 @@ type-is@~1.6.17, type-is@~1.6.18: media-typer "0.3.0" mime-types "~2.1.24" -typescript@4.0.2: - version "4.0.2" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.0.2.tgz#7ea7c88777c723c681e33bf7988be5d008d05ac2" - integrity sha512-e4ERvRV2wb+rRZ/IQeb3jm2VxBsirQLpQhdxplZ2MEzGvDkkMmPglecnNDfSUBivMjP93vRbngYYDQqQ/78bcQ== +typescript@3.9.5: + version "3.9.5" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.9.5.tgz#586f0dba300cde8be52dd1ac4f7e1009c1b13f36" + integrity sha512-hSAifV3k+i6lEoCJ2k6R2Z/rp/H3+8sdmcn5NrS3/3kE7+RyZXm9aqvxWqjEXHAd8b0pShatpcdMTvEdvAJltQ== unpipe@1.0.0, unpipe@~1.0.0: version "1.0.0"