forked from blockscout/frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
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
18d837c
commit acaa69d
Showing
6 changed files
with
90 additions
and
3 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
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
FROM nginx:stable-alpine | ||
|
||
COPY docker-entrypoint.sh / | ||
COPY check_ssl.sh / | ||
|
||
ENTRYPOINT ["/docker-entrypoint.sh"] | ||
|
||
EXPOSE 80 | ||
|
||
STOPSIGNAL SIGQUIT | ||
|
||
CMD ["nginx", "-g", "daemon off;"] |
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,14 @@ | ||
#!/bin/sh | ||
|
||
CERT_DIR="/etc/letsencrypt/live/blockscout.atleta.network" | ||
FULLCHAIN_PEM="$CERT_DIR/fullchain.pem" | ||
PRIVKEY_PEM="$CERT_DIR/privkey.pem" | ||
MD5SUM_FILE="/tmp/md5sum" | ||
|
||
while true; do | ||
sleep 3600 | ||
if [ "$(md5sum "$FULLCHAIN_PEM" "$PRIVKEY_PEM" | md5sum)" != "$(cat "$MD5SUM_FILE" || echo '')" ]; then | ||
nginx -s reload | ||
md5sum "$FULLCHAIN_PEM" "$PRIVKEY_PEM" | md5sum > "$MD5SUM_FILE" | ||
fi | ||
done |
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,49 @@ | ||
#!/bin/sh | ||
# vim:sw=4:ts=4:et | ||
|
||
# Source: https://github.com/nginxinc/docker-nginx/blob/master/stable/alpine-slim/docker-entrypoint.sh | ||
|
||
set -e | ||
|
||
entrypoint_log() { | ||
if [ -z "${NGINX_ENTRYPOINT_QUIET_LOGS:-}" ]; then | ||
echo "$@" | ||
fi | ||
} | ||
|
||
if [ "$1" = "/bin/sh" ] || [ "$1" = "nginx" ] || [ "$1" = "nginx-debug" ]; then | ||
if /usr/bin/find "/docker-entrypoint.d/" -mindepth 1 -maxdepth 1 -type f -print -quit 2>/dev/null | read v; then | ||
entrypoint_log "$0: /docker-entrypoint.d/ is not empty, will attempt to perform configuration" | ||
|
||
entrypoint_log "$0: Looking for shell scripts in /docker-entrypoint.d/" | ||
find "/docker-entrypoint.d/" -follow -type f -print | sort -V | while read -r f; do | ||
case "$f" in | ||
*.envsh) | ||
if [ -x "$f" ]; then | ||
entrypoint_log "$0: Sourcing $f"; | ||
. "$f" | ||
else | ||
# warn on shell scripts without exec bit | ||
entrypoint_log "$0: Ignoring $f, not executable"; | ||
fi | ||
;; | ||
*.sh) | ||
if [ -x "$f" ]; then | ||
entrypoint_log "$0: Launching $f"; | ||
"$f" | ||
else | ||
# warn on shell scripts without exec bit | ||
entrypoint_log "$0: Ignoring $f, not executable"; | ||
fi | ||
;; | ||
*) entrypoint_log "$0: Ignoring $f";; | ||
esac | ||
done | ||
|
||
entrypoint_log "$0: Configuration complete; ready for start up" | ||
else | ||
entrypoint_log "$0: No files found in /docker-entrypoint.d/, skipping configuration" | ||
fi | ||
fi | ||
|
||
exec "$@" |