This repository has been archived by the owner on Mar 14, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 729
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e08ac84
commit 777b937
Showing
164 changed files
with
16,165 additions
and
41,554 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,10 @@ | ||
version: "3.5" | ||
services: | ||
web-fe: | ||
build: . | ||
command: python app.py | ||
ports: | ||
- target: 5000 | ||
published: 5000 | ||
networks: | ||
- counter-net | ||
volumes: | ||
- type: volume | ||
source: counter-vol | ||
target: /code | ||
- 5000:5000 | ||
redis: | ||
image: "redis:alpine" | ||
networks: | ||
counter-net: | ||
|
||
networks: | ||
counter-net: | ||
|
||
volumes: | ||
counter-vol: | ||
ports: | ||
- 6379 |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# if you're doing anything beyond your local machine, please pin this to a specific version at https://hub.docker.com/_/node/ | ||
FROM node:lts | ||
|
||
# set our node environment, either development or production | ||
# defaults to production, compose overrides this to development on build and run | ||
ARG NODE_ENV=production | ||
ENV NODE_ENV $NODE_ENV | ||
|
||
WORKDIR /code | ||
|
||
# default to port 80 for node, and 9229 and 9230 (tests) for debug | ||
ARG PORT=80 | ||
ENV PORT $PORT | ||
EXPOSE $PORT 9229 9230 | ||
|
||
COPY package.json /code/package.json | ||
COPY package-lock.json /code/package-lock.json | ||
RUN npm ci | ||
|
||
# check every 30s to ensure this service returns HTTP 200 | ||
HEALTHCHECK --interval=30s \ | ||
CMD node healthcheck.js | ||
|
||
# copy in our source code last, as it changes the most | ||
COPY . /code | ||
|
||
# if you want to use npm start instead, then use `docker run --init in production` | ||
# so that signals are passed properly. Note the code in index.js is needed to catch Docker signals | ||
# using node here is still more graceful stopping then npm with --init afaik | ||
# I still can't come up with a good production way to run with npm and graceful shutdown | ||
CMD [ "node", "src/index.js" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2015-2017 Bret Fisher | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
const http = require("http"); | ||
|
||
const options = { | ||
timeout: 2000, | ||
host: "localhost", | ||
port: process.env.PORT || 8080, | ||
path: "/healthz" // must be the same as HEALTHCHECK in Dockerfile | ||
}; | ||
|
||
const request = http.request(options, res => { | ||
console.info("STATUS: " + res.statusCode); | ||
process.exitCode = res.statusCode === 200 ? 0 : 1; | ||
process.exit(); | ||
}); | ||
|
||
request.on("error", function(err) { | ||
console.error("ERROR", err); | ||
process.exit(1); | ||
}); | ||
|
||
request.end(); |
Oops, something went wrong.