add dockerfile

This commit is contained in:
Robin Appelman 2017-04-13 18:49:20 +02:00
commit 40dc4749cf
6 changed files with 21 additions and 1 deletions

2
.dockerignore Normal file
View file

@ -0,0 +1,2 @@
sync.js
node_modules

1
.gitignore vendored
View file

@ -1 +1,2 @@
node_modules
sync.js

12
Dockerfile Normal file
View 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
View file

@ -0,0 +1,3 @@
# Sync
Websocket api to sync playback of demos

View file

@ -1,4 +1,5 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var websocket_1 = require("websocket");
var http_1 = require("http");
var sessions = {};

View file

@ -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;