浏览代码

Merge branch 'main' into gha-init

Bret Fisher 2 年之前
父节点
当前提交
0f4f923704
共有 5 个文件被更改,包括 1094 次插入23 次删除
  1. 1 1
      docker-compose.yml
  2. 4 8
      result/Dockerfile
  3. 1085 8
      result/package-lock.json
  4. 2 2
      result/package.json
  5. 2 4
      worker/src/Worker/Program.cs

+ 1 - 1
docker-compose.yml

@@ -21,7 +21,7 @@ services:
   result:
     build: ./result
     # use nodemon rather than node for local dev
-    command: nodemon server.js
+    entrypoint: nodemon server.js
     depends_on:
       db:
         condition: service_healthy 

+ 4 - 8
result/Dockerfile

@@ -1,16 +1,12 @@
-FROM node:10-slim
+FROM node:18-slim
 
 # add curl for healthcheck
 RUN apt-get update \
     && apt-get install -y --no-install-recommends \
     curl \
+    tini \
     && rm -rf /var/lib/apt/lists/*
 
-# Add Tini for proper init of signals
-ENV TINI_VERSION v0.19.0
-ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini
-RUN chmod +x /tini
-
 WORKDIR /app
 
 # have nodemon available for local dev use (file watching)
@@ -25,7 +21,7 @@ RUN npm ci \
 COPY . .
 
 ENV PORT 80
-
 EXPOSE 80
 
-CMD ["/tini", "--", "node", "server.js"]
+ENTRYPOINT ["/usr/bin/tini", "--"]
+CMD ["node", "server.js"]

文件差异内容过多而无法显示
+ 1085 - 8
result/package-lock.json


+ 2 - 2
result/package.json

@@ -14,8 +14,8 @@
     "cookie-parser": "^1.4.4",
     "express": "^4.17.1",
     "method-override": "^3.0.0",
-    "pg": "^7.12.1",
-    "socket.io": "^2.2.0",
+    "pg": "^8.8.0",
+    "socket.io": "^2.5.0",
     "stoppable": "^1.1.0"
   }
 }

+ 2 - 4
worker/src/Worker/Program.cs

@@ -48,10 +48,8 @@ namespace Worker
                             Console.WriteLine("Reconnecting DB");
                             pgsql = OpenDbConnection("Server=db;Username=postgres;Password=postgres;");
                         }
-                        else
-                        { // Normal +1 vote requested
-                            UpdateVote(pgsql, vote.voter_id, vote.vote);
-                        }
+                        // Normal +1 vote requested
+                        UpdateVote(pgsql, vote.voter_id, vote.vote);
                     }
                     else
                     {

部分文件因为文件数量过多而无法显示