mirror of
https://github.com/demostf/sync.git
synced 2026-06-03 10:34:06 +02:00
add dockerfile
This commit is contained in:
parent
6671772d18
commit
40dc4749cf
6 changed files with 21 additions and 1 deletions
2
.dockerignore
Normal file
2
.dockerignore
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
sync.js
|
||||
node_modules
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -1 +1,2 @@
|
|||
node_modules
|
||||
sync.js
|
||||
|
|
|
|||
12
Dockerfile
Normal file
12
Dockerfile
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
FROM node:7.8-alpine
|
||||
|
||||
RUN mkdir -p /usr/src/app
|
||||
WORKDIR /usr/src/app
|
||||
|
||||
COPY package.json /usr/src/app/
|
||||
COPY sync.ts /usr/src/app/
|
||||
RUN npm install && node node_modules/.bin/tsc sync.ts && npm prune --production
|
||||
|
||||
|
||||
EXPOSE 80
|
||||
CMD [ "node", "/usr/src/app/sync.js" ]
|
||||
3
README.md
Normal file
3
README.md
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
# Sync
|
||||
|
||||
Websocket api to sync playback of demos
|
||||
1
sync.js
1
sync.js
|
|
@ -1,4 +1,5 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var websocket_1 = require("websocket");
|
||||
var http_1 = require("http");
|
||||
var sessions = {};
|
||||
|
|
|
|||
3
sync.ts
3
sync.ts
|
|
@ -30,7 +30,8 @@ interface TickPacket {
|
|||
interface PlayPacket {
|
||||
type: 'play';
|
||||
session: string;
|
||||
play: boolean;
|
||||
play?: boolean;
|
||||
tick?: boolean; //old sync server
|
||||
}
|
||||
|
||||
type Packet = JoinPacket | CreatePacket | TickPacket | PlayPacket;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue