Merge branch 'main' into gha-init

This commit is contained in:
Bret Fisher
2022-12-16 16:34:47 -05:00
5 changed files with 1364 additions and 246 deletions

View File

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

View File

@@ -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"]

1586
result/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -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"
}
}

View File

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