mirror of
https://github.com/dockersamples/example-voting-app.git
synced 2026-07-10 17:09:28 +00:00
Merge branch 'main' into gha-init
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
1586
result/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -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"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user