diff --git a/docker-compose.test.yml b/docker-compose.test.yml new file mode 100644 index 0000000..0e1ef53 --- /dev/null +++ b/docker-compose.test.yml @@ -0,0 +1,27 @@ +services: + push: + build: + context: . + dockerfile: ./Dockerfile + restart: unless-stopped + environment: + PORT: 8080 + DEV: "1" + ports: + - "8201:8080" + volumes: + - ./src:/srv/app + - ./storage:/storage + - ./database:/database + + php: + build: + context: . + dockerfile: ./php-test/Dockerfile + restart: unless-stopped + depends_on: + - push + ports: + - "8123:80" + volumes: + - ./public/:/var/www/html diff --git a/php-test/Dockerfile b/php-test/Dockerfile new file mode 100644 index 0000000..fc117d4 --- /dev/null +++ b/php-test/Dockerfile @@ -0,0 +1,6 @@ +FROM php:8.2-apache + +RUN apt-get update \ + && apt-get install -y --no-install-recommends libcurl4-openssl-dev \ + && docker-php-ext-install curl \ + && rm -rf /var/lib/apt/lists/* diff --git a/public/index.html b/public/index.html index 3ca54dd..a77edc5 100644 --- a/public/index.html +++ b/public/index.html @@ -1,20 +1,25 @@ - -
diff --git a/src/storage.js b/src/storage.js
index 1702166..751ea79 100644
--- a/src/storage.js
+++ b/src/storage.js
@@ -74,10 +74,15 @@ class Storage {
});
}
async readQueueAll() {
- const all = await fsp.readFile(this.fileName,"utf-8");
- return all.split("\n")
- .filter(line => line.trim())
- .map(line => JSON.parse(line));
+ let ret = [];
+ try {
+ const all = await fsp.readFile(this.fileName,"utf-8");
+ ret = all.split("\n")
+ .filter(line => line.trim())
+ .map(line => JSON.parse(line));
+ } catch (err) {}
+
+ return ret;
}
async readConfig() {