Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for custom /app/nginx.conf #122

Merged
merged 1 commit into from
Feb 2, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 23 additions & 19 deletions python2.7-alpine3.7/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,30 @@ USE_STATIC_PATH=${STATIC_PATH:-'/app/static'}
# Get the listen port for Nginx, default to 80
USE_LISTEN_PORT=${LISTEN_PORT:-80}

content_server='server {\n'
content_server=$content_server" listen ${USE_LISTEN_PORT};\n"
content_server=$content_server' location / {\n'
content_server=$content_server' try_files $uri @app;\n'
content_server=$content_server' }\n'
content_server=$content_server' location @app {\n'
content_server=$content_server' include uwsgi_params;\n'
content_server=$content_server' uwsgi_pass unix:///tmp/uwsgi.sock;\n'
content_server=$content_server' }\n'
content_server=$content_server" location $USE_STATIC_URL {\n"
content_server=$content_server" alias $USE_STATIC_PATH;\n"
content_server=$content_server' }\n'
# If STATIC_INDEX is 1, serve / with /static/index.html directly (or the static URL configured)
if [ "$STATIC_INDEX" = 1 ] ; then
content_server=$content_server' location = / {\n'
content_server=$content_server" index $USE_STATIC_URL/index.html;\n"
if [ -f /app/nginx.conf ]; then
cp /app/nginx.conf /etc/nginx/nginx.conf
else
content_server='server {\n'
content_server=$content_server" listen ${USE_LISTEN_PORT};\n"
content_server=$content_server' location / {\n'
content_server=$content_server' try_files $uri @app;\n'
content_server=$content_server' }\n'
content_server=$content_server' location @app {\n'
content_server=$content_server' include uwsgi_params;\n'
content_server=$content_server' uwsgi_pass unix:///tmp/uwsgi.sock;\n'
content_server=$content_server' }\n'
content_server=$content_server" location $USE_STATIC_URL {\n"
content_server=$content_server" alias $USE_STATIC_PATH;\n"
content_server=$content_server' }\n'
# If STATIC_INDEX is 1, serve / with /static/index.html directly (or the static URL configured)
if [ "$STATIC_INDEX" = 1 ] ; then
content_server=$content_server' location = / {\n'
content_server=$content_server" index $USE_STATIC_URL/index.html;\n"
content_server=$content_server' }\n'
fi
content_server=$content_server'}\n'
# Save generated server /etc/nginx/conf.d/nginx.conf
printf "$content_server" > /etc/nginx/conf.d/nginx.conf
fi
content_server=$content_server'}\n'
# Save generated server /etc/nginx/conf.d/nginx.conf
printf "$content_server" > /etc/nginx/conf.d/nginx.conf

exec "$@"
42 changes: 23 additions & 19 deletions python2.7-alpine3.8/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,30 @@ USE_STATIC_PATH=${STATIC_PATH:-'/app/static'}
# Get the listen port for Nginx, default to 80
USE_LISTEN_PORT=${LISTEN_PORT:-80}

content_server='server {\n'
content_server=$content_server" listen ${USE_LISTEN_PORT};\n"
content_server=$content_server' location / {\n'
content_server=$content_server' try_files $uri @app;\n'
content_server=$content_server' }\n'
content_server=$content_server' location @app {\n'
content_server=$content_server' include uwsgi_params;\n'
content_server=$content_server' uwsgi_pass unix:///tmp/uwsgi.sock;\n'
content_server=$content_server' }\n'
content_server=$content_server" location $USE_STATIC_URL {\n"
content_server=$content_server" alias $USE_STATIC_PATH;\n"
content_server=$content_server' }\n'
# If STATIC_INDEX is 1, serve / with /static/index.html directly (or the static URL configured)
if [ "$STATIC_INDEX" = 1 ] ; then
content_server=$content_server' location = / {\n'
content_server=$content_server" index $USE_STATIC_URL/index.html;\n"
if [ -f /app/nginx.conf ]; then
cp /app/nginx.conf /etc/nginx/nginx.conf
else
content_server='server {\n'
content_server=$content_server" listen ${USE_LISTEN_PORT};\n"
content_server=$content_server' location / {\n'
content_server=$content_server' try_files $uri @app;\n'
content_server=$content_server' }\n'
content_server=$content_server' location @app {\n'
content_server=$content_server' include uwsgi_params;\n'
content_server=$content_server' uwsgi_pass unix:///tmp/uwsgi.sock;\n'
content_server=$content_server' }\n'
content_server=$content_server" location $USE_STATIC_URL {\n"
content_server=$content_server" alias $USE_STATIC_PATH;\n"
content_server=$content_server' }\n'
# If STATIC_INDEX is 1, serve / with /static/index.html directly (or the static URL configured)
if [ "$STATIC_INDEX" = 1 ] ; then
content_server=$content_server' location = / {\n'
content_server=$content_server" index $USE_STATIC_URL/index.html;\n"
content_server=$content_server' }\n'
fi
content_server=$content_server'}\n'
# Save generated server /etc/nginx/conf.d/nginx.conf
printf "$content_server" > /etc/nginx/conf.d/nginx.conf
fi
content_server=$content_server'}\n'
# Save generated server /etc/nginx/conf.d/nginx.conf
printf "$content_server" > /etc/nginx/conf.d/nginx.conf

exec "$@"
42 changes: 23 additions & 19 deletions python2.7/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,30 @@ USE_STATIC_PATH=${STATIC_PATH:-'/app/static'}
# Get the listen port for Nginx, default to 80
USE_LISTEN_PORT=${LISTEN_PORT:-80}

content_server='server {\n'
content_server=$content_server" listen ${USE_LISTEN_PORT};\n"
content_server=$content_server' location / {\n'
content_server=$content_server' try_files $uri @app;\n'
content_server=$content_server' }\n'
content_server=$content_server' location @app {\n'
content_server=$content_server' include uwsgi_params;\n'
content_server=$content_server' uwsgi_pass unix:///tmp/uwsgi.sock;\n'
content_server=$content_server' }\n'
content_server=$content_server" location $USE_STATIC_URL {\n"
content_server=$content_server" alias $USE_STATIC_PATH;\n"
content_server=$content_server' }\n'
# If STATIC_INDEX is 1, serve / with /static/index.html directly (or the static URL configured)
if [ "$STATIC_INDEX" = 1 ] ; then
content_server=$content_server' location = / {\n'
content_server=$content_server" index $USE_STATIC_URL/index.html;\n"
if [ -f /app/nginx.conf ]; then
cp /app/nginx.conf /etc/nginx/nginx.conf
else
content_server='server {\n'
content_server=$content_server" listen ${USE_LISTEN_PORT};\n"
content_server=$content_server' location / {\n'
content_server=$content_server' try_files $uri @app;\n'
content_server=$content_server' }\n'
content_server=$content_server' location @app {\n'
content_server=$content_server' include uwsgi_params;\n'
content_server=$content_server' uwsgi_pass unix:///tmp/uwsgi.sock;\n'
content_server=$content_server' }\n'
content_server=$content_server" location $USE_STATIC_URL {\n"
content_server=$content_server" alias $USE_STATIC_PATH;\n"
content_server=$content_server' }\n'
# If STATIC_INDEX is 1, serve / with /static/index.html directly (or the static URL configured)
if [ "$STATIC_INDEX" = 1 ] ; then
content_server=$content_server' location = / {\n'
content_server=$content_server" index $USE_STATIC_URL/index.html;\n"
content_server=$content_server' }\n'
fi
content_server=$content_server'}\n'
# Save generated server /etc/nginx/conf.d/nginx.conf
printf "$content_server" > /etc/nginx/conf.d/nginx.conf
fi
content_server=$content_server'}\n'
# Save generated server /etc/nginx/conf.d/nginx.conf
printf "$content_server" > /etc/nginx/conf.d/nginx.conf

exec "$@"
42 changes: 23 additions & 19 deletions python3.5/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,30 @@ USE_STATIC_PATH=${STATIC_PATH:-'/app/static'}
# Get the listen port for Nginx, default to 80
USE_LISTEN_PORT=${LISTEN_PORT:-80}

content_server='server {\n'
content_server=$content_server" listen ${USE_LISTEN_PORT};\n"
content_server=$content_server' location / {\n'
content_server=$content_server' try_files $uri @app;\n'
content_server=$content_server' }\n'
content_server=$content_server' location @app {\n'
content_server=$content_server' include uwsgi_params;\n'
content_server=$content_server' uwsgi_pass unix:///tmp/uwsgi.sock;\n'
content_server=$content_server' }\n'
content_server=$content_server" location $USE_STATIC_URL {\n"
content_server=$content_server" alias $USE_STATIC_PATH;\n"
content_server=$content_server' }\n'
# If STATIC_INDEX is 1, serve / with /static/index.html directly (or the static URL configured)
if [ "$STATIC_INDEX" = 1 ] ; then
content_server=$content_server' location = / {\n'
content_server=$content_server" index $USE_STATIC_URL/index.html;\n"
if [ -f /app/nginx.conf ]; then
cp /app/nginx.conf /etc/nginx/nginx.conf
else
content_server='server {\n'
content_server=$content_server" listen ${USE_LISTEN_PORT};\n"
content_server=$content_server' location / {\n'
content_server=$content_server' try_files $uri @app;\n'
content_server=$content_server' }\n'
content_server=$content_server' location @app {\n'
content_server=$content_server' include uwsgi_params;\n'
content_server=$content_server' uwsgi_pass unix:///tmp/uwsgi.sock;\n'
content_server=$content_server' }\n'
content_server=$content_server" location $USE_STATIC_URL {\n"
content_server=$content_server" alias $USE_STATIC_PATH;\n"
content_server=$content_server' }\n'
# If STATIC_INDEX is 1, serve / with /static/index.html directly (or the static URL configured)
if [ "$STATIC_INDEX" = 1 ] ; then
content_server=$content_server' location = / {\n'
content_server=$content_server" index $USE_STATIC_URL/index.html;\n"
content_server=$content_server' }\n'
fi
content_server=$content_server'}\n'
# Save generated server /etc/nginx/conf.d/nginx.conf
printf "$content_server" > /etc/nginx/conf.d/nginx.conf
fi
content_server=$content_server'}\n'
# Save generated server /etc/nginx/conf.d/nginx.conf
printf "$content_server" > /etc/nginx/conf.d/nginx.conf

exec "$@"
42 changes: 23 additions & 19 deletions python3.6-alpine3.7/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,30 @@ USE_STATIC_PATH=${STATIC_PATH:-'/app/static'}
# Get the listen port for Nginx, default to 80
USE_LISTEN_PORT=${LISTEN_PORT:-80}

content_server='server {\n'
content_server=$content_server" listen ${USE_LISTEN_PORT};\n"
content_server=$content_server' location / {\n'
content_server=$content_server' try_files $uri @app;\n'
content_server=$content_server' }\n'
content_server=$content_server' location @app {\n'
content_server=$content_server' include uwsgi_params;\n'
content_server=$content_server' uwsgi_pass unix:///tmp/uwsgi.sock;\n'
content_server=$content_server' }\n'
content_server=$content_server" location $USE_STATIC_URL {\n"
content_server=$content_server" alias $USE_STATIC_PATH;\n"
content_server=$content_server' }\n'
# If STATIC_INDEX is 1, serve / with /static/index.html directly (or the static URL configured)
if [ "$STATIC_INDEX" = 1 ] ; then
content_server=$content_server' location = / {\n'
content_server=$content_server" index $USE_STATIC_URL/index.html;\n"
if [ -f /app/nginx.conf ]; then
cp /app/nginx.conf /etc/nginx/nginx.conf
else
content_server='server {\n'
content_server=$content_server" listen ${USE_LISTEN_PORT};\n"
content_server=$content_server' location / {\n'
content_server=$content_server' try_files $uri @app;\n'
content_server=$content_server' }\n'
content_server=$content_server' location @app {\n'
content_server=$content_server' include uwsgi_params;\n'
content_server=$content_server' uwsgi_pass unix:///tmp/uwsgi.sock;\n'
content_server=$content_server' }\n'
content_server=$content_server" location $USE_STATIC_URL {\n"
content_server=$content_server" alias $USE_STATIC_PATH;\n"
content_server=$content_server' }\n'
# If STATIC_INDEX is 1, serve / with /static/index.html directly (or the static URL configured)
if [ "$STATIC_INDEX" = 1 ] ; then
content_server=$content_server' location = / {\n'
content_server=$content_server" index $USE_STATIC_URL/index.html;\n"
content_server=$content_server' }\n'
fi
content_server=$content_server'}\n'
# Save generated server /etc/nginx/conf.d/nginx.conf
printf "$content_server" > /etc/nginx/conf.d/nginx.conf
fi
content_server=$content_server'}\n'
# Save generated server /etc/nginx/conf.d/nginx.conf
printf "$content_server" > /etc/nginx/conf.d/nginx.conf

exec "$@"
42 changes: 23 additions & 19 deletions python3.6-alpine3.8/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,30 @@ USE_STATIC_PATH=${STATIC_PATH:-'/app/static'}
# Get the listen port for Nginx, default to 80
USE_LISTEN_PORT=${LISTEN_PORT:-80}

content_server='server {\n'
content_server=$content_server" listen ${USE_LISTEN_PORT};\n"
content_server=$content_server' location / {\n'
content_server=$content_server' try_files $uri @app;\n'
content_server=$content_server' }\n'
content_server=$content_server' location @app {\n'
content_server=$content_server' include uwsgi_params;\n'
content_server=$content_server' uwsgi_pass unix:///tmp/uwsgi.sock;\n'
content_server=$content_server' }\n'
content_server=$content_server" location $USE_STATIC_URL {\n"
content_server=$content_server" alias $USE_STATIC_PATH;\n"
content_server=$content_server' }\n'
# If STATIC_INDEX is 1, serve / with /static/index.html directly (or the static URL configured)
if [ "$STATIC_INDEX" = 1 ] ; then
content_server=$content_server' location = / {\n'
content_server=$content_server" index $USE_STATIC_URL/index.html;\n"
if [ -f /app/nginx.conf ]; then
cp /app/nginx.conf /etc/nginx/nginx.conf
else
content_server='server {\n'
content_server=$content_server" listen ${USE_LISTEN_PORT};\n"
content_server=$content_server' location / {\n'
content_server=$content_server' try_files $uri @app;\n'
content_server=$content_server' }\n'
content_server=$content_server' location @app {\n'
content_server=$content_server' include uwsgi_params;\n'
content_server=$content_server' uwsgi_pass unix:///tmp/uwsgi.sock;\n'
content_server=$content_server' }\n'
content_server=$content_server" location $USE_STATIC_URL {\n"
content_server=$content_server" alias $USE_STATIC_PATH;\n"
content_server=$content_server' }\n'
# If STATIC_INDEX is 1, serve / with /static/index.html directly (or the static URL configured)
if [ "$STATIC_INDEX" = 1 ] ; then
content_server=$content_server' location = / {\n'
content_server=$content_server" index $USE_STATIC_URL/index.html;\n"
content_server=$content_server' }\n'
fi
content_server=$content_server'}\n'
# Save generated server /etc/nginx/conf.d/nginx.conf
printf "$content_server" > /etc/nginx/conf.d/nginx.conf
fi
content_server=$content_server'}\n'
# Save generated server /etc/nginx/conf.d/nginx.conf
printf "$content_server" > /etc/nginx/conf.d/nginx.conf

exec "$@"
42 changes: 23 additions & 19 deletions python3.6/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,30 @@ USE_STATIC_PATH=${STATIC_PATH:-'/app/static'}
# Get the listen port for Nginx, default to 80
USE_LISTEN_PORT=${LISTEN_PORT:-80}

content_server='server {\n'
content_server=$content_server" listen ${USE_LISTEN_PORT};\n"
content_server=$content_server' location / {\n'
content_server=$content_server' try_files $uri @app;\n'
content_server=$content_server' }\n'
content_server=$content_server' location @app {\n'
content_server=$content_server' include uwsgi_params;\n'
content_server=$content_server' uwsgi_pass unix:///tmp/uwsgi.sock;\n'
content_server=$content_server' }\n'
content_server=$content_server" location $USE_STATIC_URL {\n"
content_server=$content_server" alias $USE_STATIC_PATH;\n"
content_server=$content_server' }\n'
# If STATIC_INDEX is 1, serve / with /static/index.html directly (or the static URL configured)
if [ "$STATIC_INDEX" = 1 ] ; then
content_server=$content_server' location = / {\n'
content_server=$content_server" index $USE_STATIC_URL/index.html;\n"
if [ -f /app/nginx.conf ]; then
cp /app/nginx.conf /etc/nginx/nginx.conf
else
content_server='server {\n'
content_server=$content_server" listen ${USE_LISTEN_PORT};\n"
content_server=$content_server' location / {\n'
content_server=$content_server' try_files $uri @app;\n'
content_server=$content_server' }\n'
content_server=$content_server' location @app {\n'
content_server=$content_server' include uwsgi_params;\n'
content_server=$content_server' uwsgi_pass unix:///tmp/uwsgi.sock;\n'
content_server=$content_server' }\n'
content_server=$content_server" location $USE_STATIC_URL {\n"
content_server=$content_server" alias $USE_STATIC_PATH;\n"
content_server=$content_server' }\n'
# If STATIC_INDEX is 1, serve / with /static/index.html directly (or the static URL configured)
if [ "$STATIC_INDEX" = 1 ] ; then
content_server=$content_server' location = / {\n'
content_server=$content_server" index $USE_STATIC_URL/index.html;\n"
content_server=$content_server' }\n'
fi
content_server=$content_server'}\n'
# Save generated server /etc/nginx/conf.d/nginx.conf
printf "$content_server" > /etc/nginx/conf.d/nginx.conf
fi
content_server=$content_server'}\n'
# Save generated server /etc/nginx/conf.d/nginx.conf
printf "$content_server" > /etc/nginx/conf.d/nginx.conf

exec "$@"
42 changes: 23 additions & 19 deletions python3.7-alpine3.7/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,30 @@ USE_STATIC_PATH=${STATIC_PATH:-'/app/static'}
# Get the listen port for Nginx, default to 80
USE_LISTEN_PORT=${LISTEN_PORT:-80}

content_server='server {\n'
content_server=$content_server" listen ${USE_LISTEN_PORT};\n"
content_server=$content_server' location / {\n'
content_server=$content_server' try_files $uri @app;\n'
content_server=$content_server' }\n'
content_server=$content_server' location @app {\n'
content_server=$content_server' include uwsgi_params;\n'
content_server=$content_server' uwsgi_pass unix:///tmp/uwsgi.sock;\n'
content_server=$content_server' }\n'
content_server=$content_server" location $USE_STATIC_URL {\n"
content_server=$content_server" alias $USE_STATIC_PATH;\n"
content_server=$content_server' }\n'
# If STATIC_INDEX is 1, serve / with /static/index.html directly (or the static URL configured)
if [ "$STATIC_INDEX" = 1 ] ; then
content_server=$content_server' location = / {\n'
content_server=$content_server" index $USE_STATIC_URL/index.html;\n"
if [ -f /app/nginx.conf ]; then
cp /app/nginx.conf /etc/nginx/nginx.conf
else
content_server='server {\n'
content_server=$content_server" listen ${USE_LISTEN_PORT};\n"
content_server=$content_server' location / {\n'
content_server=$content_server' try_files $uri @app;\n'
content_server=$content_server' }\n'
content_server=$content_server' location @app {\n'
content_server=$content_server' include uwsgi_params;\n'
content_server=$content_server' uwsgi_pass unix:///tmp/uwsgi.sock;\n'
content_server=$content_server' }\n'
content_server=$content_server" location $USE_STATIC_URL {\n"
content_server=$content_server" alias $USE_STATIC_PATH;\n"
content_server=$content_server' }\n'
# If STATIC_INDEX is 1, serve / with /static/index.html directly (or the static URL configured)
if [ "$STATIC_INDEX" = 1 ] ; then
content_server=$content_server' location = / {\n'
content_server=$content_server" index $USE_STATIC_URL/index.html;\n"
content_server=$content_server' }\n'
fi
content_server=$content_server'}\n'
# Save generated server /etc/nginx/conf.d/nginx.conf
printf "$content_server" > /etc/nginx/conf.d/nginx.conf
fi
content_server=$content_server'}\n'
# Save generated server /etc/nginx/conf.d/nginx.conf
printf "$content_server" > /etc/nginx/conf.d/nginx.conf

exec "$@"
Loading