forked from CUHK-SE-Group/train-ticket
-
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
Showing
4 changed files
with
263 additions
and
215 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 |
---|---|---|
@@ -1,14 +1,20 @@ | ||
FROM nginx:1.23.1 | ||
|
||
|
||
RUN /bin/cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' >/etc/timezone | ||
RUN apt-get update ; apt-get install unzip | ||
|
||
ADD https://github.com/open-telemetry/opentelemetry-cpp-contrib/releases/download/webserver%2Fv1.0.3/opentelemetry-webserver-sdk-x64-linux.tgz /opt | ||
|
||
RUN cd /opt ; unzip opentelemetry-webserver-sdk-x64-linux.tgz.zip; tar xvfz opentelemetry-webserver-sdk-x64-linux.tgz | ||
RUN cd /opt/opentelemetry-webserver-sdk; ./install.sh | ||
|
||
ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/opentelemetry-webserver-sdk/sdk_lib/lib | ||
RUN echo "load_module /opt/opentelemetry-webserver-sdk/WebServerModule/Nginx/1.23.1/ngx_http_opentelemetry_module.so;\n$(cat /etc/nginx/nginx.conf)" > /etc/nginx/nginx.conf | ||
|
||
COPY opentelemetry_module.conf /etc/nginx/conf.d | ||
COPY nginx.conf /etc/nginx/nginx.conf | ||
COPY server.conf /etc/nginx/conf.d | ||
COPY static /usr/share/nginx/html | ||
RUN ulimit -n 65535 | ||
COPY docker-entrypoint.sh /docker-entrypoint.sh | ||
|
||
ENTRYPOINT ["/docker-entrypoint.sh"] | ||
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,41 @@ | ||
#!/bin/sh | ||
# vim:sw=4:ts=4:et | ||
|
||
set -e | ||
|
||
# 设置文件描述符限制 | ||
ulimit -n 65535 | ||
|
||
if [ -z "${NGINX_ENTRYPOINT_QUIET_LOGS:-}" ]; then | ||
exec 3>&1 | ||
else | ||
exec 3>/dev/null | ||
fi | ||
|
||
if [ "$1" = "nginx" -o "$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 | ||
echo >&3 "$0: /docker-entrypoint.d/ is not empty, will attempt to perform configuration" | ||
|
||
echo >&3 "$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 | ||
*.sh) | ||
if [ -x "$f" ]; then | ||
echo >&3 "$0: Launching $f"; | ||
"$f" | ||
else | ||
# warn on shell scripts without exec bit | ||
echo >&3 "$0: Ignoring $f, not executable"; | ||
fi | ||
;; | ||
*) echo >&3 "$0: Ignoring $f";; | ||
esac | ||
done | ||
|
||
echo >&3 "$0: Configuration complete; ready for start up" | ||
else | ||
echo >&3 "$0: No files found in /docker-entrypoint.d/, skipping configuration" | ||
fi | ||
fi | ||
|
||
exec "$@" |
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
Oops, something went wrong.