-
Notifications
You must be signed in to change notification settings - Fork 91
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
9149c55
commit 9cc03ef
Showing
4 changed files
with
34 additions
and
14 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -65,6 +65,9 @@ COPY --from=builder /usr/local/bin/pandoc /usr/local/bin/pandoc | |
# Install git for good since the git client requires it | ||
RUN apk add --no-cache git | ||
|
||
# Install curl for good since the health check requires it | ||
RUN apk add --no-cache curl | ||
|
||
# configure git | ||
RUN git config --global user.email "[email protected]" | ||
RUN git config --global user.name "Your Name" | ||
|
@@ -74,7 +77,6 @@ RUN git config --global user.name "Your Name" | |
# todo: work out how to fix this | ||
RUN git config --global --add safe.directory '*' | ||
|
||
|
||
# Install necessary packages for Puppeteer | ||
RUN apk add --no-cache \ | ||
chromium \ | ||
|
@@ -136,13 +138,7 @@ FROM source AS prod | |
RUN node ./app/documentation/build/index.js --no-watch | ||
|
||
HEALTHCHECK --interval=30s --timeout=5s --start-period=5s --retries=3 \ | ||
CMD node -e "\ | ||
const http = require('http'); \ | ||
const options = { hostname: 'localhost', port: 8080, path: '/health', timeout: 5000 }; \ | ||
const req = http.request(options, (res) => { \ | ||
if (res.statusCode === 200) process.exit(0); else process.exit(1); \ | ||
}); \ | ||
req.on('error', () => process.exit(1)); \ | ||
req.end();" | ||
|
||
CMD ["node", "./app/index.js"] | ||
CMD curl --fail http://localhost:8080/health || exit 1 | ||
|
||
# Redirect logs to a file | ||
CMD ["sh", "-c", "node ./app/index.js >> ./data/logs/app.log 2>&1"] |
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
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