aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--Dockerfile4
-rw-r--r--docker-compose.yml4
-rw-r--r--package.json2
-rw-r--r--src/App.js6
5 files changed, 10 insertions, 7 deletions
diff --git a/.gitignore b/.gitignore
index c80ad90..85bf288 100644
--- a/.gitignore
+++ b/.gitignore
@@ -9,6 +9,7 @@
# production
/build/
/saves/
+/permasaves/
/__pycache__
# misc
diff --git a/Dockerfile b/Dockerfile
index 2dc7775..a6fed73 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -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"
diff --git a/src/App.js b/src/App.js
index 16a5a7d..2d4f40f 100644
--- a/src/App.js
+++ b/src/App.js
@@ -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;