diff options
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | Dockerfile | 4 | ||||
-rw-r--r-- | docker-compose.yml | 4 | ||||
-rw-r--r-- | package.json | 2 | ||||
-rw-r--r-- | src/App.js | 6 |
5 files changed, 10 insertions, 7 deletions
@@ -9,6 +9,7 @@ # production /build/ /saves/ +/permasaves/ /__pycache__ # misc @@ -1,6 +1,6 @@ FROM python:latest RUN pip install unicornhathd Flask Flask-Sockets RUN pip install numpy -COPY build/ . -COPY server.py . +COPY build/ /build/ +COPY server.py / ENTRYPOINT python server.py diff --git a/docker-compose.yml b/docker-compose.yml index ff87e58..ebeb531 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -6,5 +6,7 @@ services: ports: - "3001:3001" volumes: - - "/dev/spidev0.0:/dev/spidev0.0" - "/home/pi/docker/unicornpaint/saves/:/saves/" + devices: + - "/dev/spidev0.0:/dev/spidev0.0" + restart: always diff --git a/package.json b/package.json index 6086efb..745911b 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "react-twitter-widgets": "^1.7.1" }, "scripts": { - "start": "react-scripts start", + "start": "export PORT=3001 && react-scripts start", "build": "react-scripts build", "test": "react-scripts test --env=jsdom", "eject": "react-scripts eject" @@ -143,10 +143,10 @@ class App extends Component { } _connectWebsocket() { - let webSocketProto = window.location.protocol === "https" ? "wss" : "ws" + let webSocketProto = window.location.protocol === "https:" ? "wss:" : "ws:" let host = window.location.host // let host = "shinypi:3001" - this._websocket = new WebSocket(`${webSocketProto}://${host}/ws`) + this._websocket = new WebSocket(`${webSocketProto}//${host}/ws`) this._websocket.onmessage = this._onMessage this._websocket.onopen = this._onOpen this._websocket.onclose = this._onClose @@ -260,4 +260,4 @@ class App extends Component { } } -export default App;
\ No newline at end of file +export default App; |