diff --git a/README.md b/README.md index 4ff09f91..a146f91c 100644 --- a/README.md +++ b/README.md @@ -853,6 +853,10 @@ You will see your Flask debugging server start, you will see how it sends respon ## What's new +2019-05-10: + +* Move `/start.sh` and `/app/prestart.sh` functionality to parent image. [PR #134](https://github.com/tiangolo/uwsgi-nginx-flask-docker/pull/134). + 2019-02-02: * The Nginx configurations are generated dynamically from the entrypoint, instead of modifying pre-existing files. [PR #50 in the parent image `uwsgi-nginx`](https://github.com/tiangolo/uwsgi-nginx-docker/pull/50) and [PR #121](https://github.com/tiangolo/uwsgi-nginx-flask-docker/pull/121). diff --git a/python2.7-alpine3.7/Dockerfile b/python2.7-alpine3.7/Dockerfile index 8f0572fb..4ea2bebd 100644 --- a/python2.7-alpine3.7/Dockerfile +++ b/python2.7-alpine3.7/Dockerfile @@ -21,10 +21,6 @@ WORKDIR /app # Make /app/* available to be imported by Python globally to better support several use cases like Alembic migrations. ENV PYTHONPATH=/app -# Copy start.sh script that will check for a /app/prestart.sh script and run it before starting the app -COPY start.sh /start.sh -RUN chmod +x /start.sh - # Move the base entrypoint to reuse it RUN mv /entrypoint.sh /uwsgi-nginx-entrypoint.sh # Copy the entrypoint that will generate Nginx additional configs @@ -33,6 +29,7 @@ RUN chmod +x /entrypoint.sh ENTRYPOINT ["/entrypoint.sh"] -# Run the start script, it will check for an /app/prestart.sh script (e.g. for migrations) +# Run the start script provided by the parent image tiangolo/uwsgi-nginx. +# It will check for an /app/prestart.sh script (e.g. for migrations) # And then will start Supervisor, which in turn will start Nginx and uWSGI CMD ["/start.sh"] diff --git a/python2.7-alpine3.7/start.sh b/python2.7-alpine3.7/start.sh deleted file mode 100644 index 8626c151..00000000 --- a/python2.7-alpine3.7/start.sh +++ /dev/null @@ -1,15 +0,0 @@ -#! /usr/bin/env sh -set -e - -# If there's a prestart.sh script in the /app directory, run it before starting -PRE_START_PATH=/app/prestart.sh -echo "Checking for script in $PRE_START_PATH" -if [ -f $PRE_START_PATH ] ; then - echo "Running script $PRE_START_PATH" - source $PRE_START_PATH -else - echo "There is no script $PRE_START_PATH" -fi - -# Start Supervisor, with Nginx and uWSGI -exec /usr/bin/supervisord diff --git a/python2.7-alpine3.8/Dockerfile b/python2.7-alpine3.8/Dockerfile index c69a956b..bd73e2ff 100644 --- a/python2.7-alpine3.8/Dockerfile +++ b/python2.7-alpine3.8/Dockerfile @@ -21,10 +21,6 @@ WORKDIR /app # Make /app/* available to be imported by Python globally to better support several use cases like Alembic migrations. ENV PYTHONPATH=/app -# Copy start.sh script that will check for a /app/prestart.sh script and run it before starting the app -COPY start.sh /start.sh -RUN chmod +x /start.sh - # Move the base entrypoint to reuse it RUN mv /entrypoint.sh /uwsgi-nginx-entrypoint.sh # Copy the entrypoint that will generate Nginx additional configs @@ -33,6 +29,7 @@ RUN chmod +x /entrypoint.sh ENTRYPOINT ["/entrypoint.sh"] -# Run the start script, it will check for an /app/prestart.sh script (e.g. for migrations) +# Run the start script provided by the parent image tiangolo/uwsgi-nginx. +# It will check for an /app/prestart.sh script (e.g. for migrations) # And then will start Supervisor, which in turn will start Nginx and uWSGI CMD ["/start.sh"] diff --git a/python2.7-alpine3.8/start.sh b/python2.7-alpine3.8/start.sh deleted file mode 100644 index 8626c151..00000000 --- a/python2.7-alpine3.8/start.sh +++ /dev/null @@ -1,15 +0,0 @@ -#! /usr/bin/env sh -set -e - -# If there's a prestart.sh script in the /app directory, run it before starting -PRE_START_PATH=/app/prestart.sh -echo "Checking for script in $PRE_START_PATH" -if [ -f $PRE_START_PATH ] ; then - echo "Running script $PRE_START_PATH" - source $PRE_START_PATH -else - echo "There is no script $PRE_START_PATH" -fi - -# Start Supervisor, with Nginx and uWSGI -exec /usr/bin/supervisord diff --git a/python2.7/Dockerfile b/python2.7/Dockerfile index cf2c3094..1f3f53d2 100644 --- a/python2.7/Dockerfile +++ b/python2.7/Dockerfile @@ -21,10 +21,6 @@ WORKDIR /app # Make /app/* available to be imported by Python globally to better support several use cases like Alembic migrations. ENV PYTHONPATH=/app -# Copy start.sh script that will check for a /app/prestart.sh script and run it before starting the app -COPY start.sh /start.sh -RUN chmod +x /start.sh - # Move the base entrypoint to reuse it RUN mv /entrypoint.sh /uwsgi-nginx-entrypoint.sh # Copy the entrypoint that will generate Nginx additional configs @@ -33,6 +29,7 @@ RUN chmod +x /entrypoint.sh ENTRYPOINT ["/entrypoint.sh"] -# Run the start script, it will check for an /app/prestart.sh script (e.g. for migrations) +# Run the start script provided by the parent image tiangolo/uwsgi-nginx. +# It will check for an /app/prestart.sh script (e.g. for migrations) # And then will start Supervisor, which in turn will start Nginx and uWSGI CMD ["/start.sh"] diff --git a/python2.7/start.sh b/python2.7/start.sh deleted file mode 100644 index 81580305..00000000 --- a/python2.7/start.sh +++ /dev/null @@ -1,15 +0,0 @@ -#! /usr/bin/env bash -set -e - -# If there's a prestart.sh script in the /app directory, run it before starting -PRE_START_PATH=/app/prestart.sh -echo "Checking for script in $PRE_START_PATH" -if [ -f $PRE_START_PATH ] ; then - echo "Running script $PRE_START_PATH" - source $PRE_START_PATH -else - echo "There is no script $PRE_START_PATH" -fi - -# Start Supervisor, with Nginx and uWSGI -exec /usr/bin/supervisord diff --git a/python3.5/Dockerfile b/python3.5/Dockerfile index d5e790c9..4d7e3b6c 100644 --- a/python3.5/Dockerfile +++ b/python3.5/Dockerfile @@ -21,10 +21,6 @@ WORKDIR /app # Make /app/* available to be imported by Python globally to better support several use cases like Alembic migrations. ENV PYTHONPATH=/app -# Copy start.sh script that will check for a /app/prestart.sh script and run it before starting the app -COPY start.sh /start.sh -RUN chmod +x /start.sh - # Move the base entrypoint to reuse it RUN mv /entrypoint.sh /uwsgi-nginx-entrypoint.sh # Copy the entrypoint that will generate Nginx additional configs @@ -33,6 +29,7 @@ RUN chmod +x /entrypoint.sh ENTRYPOINT ["/entrypoint.sh"] -# Run the start script, it will check for an /app/prestart.sh script (e.g. for migrations) +# Run the start script provided by the parent image tiangolo/uwsgi-nginx. +# It will check for an /app/prestart.sh script (e.g. for migrations) # And then will start Supervisor, which in turn will start Nginx and uWSGI CMD ["/start.sh"] diff --git a/python3.5/start.sh b/python3.5/start.sh deleted file mode 100644 index 81580305..00000000 --- a/python3.5/start.sh +++ /dev/null @@ -1,15 +0,0 @@ -#! /usr/bin/env bash -set -e - -# If there's a prestart.sh script in the /app directory, run it before starting -PRE_START_PATH=/app/prestart.sh -echo "Checking for script in $PRE_START_PATH" -if [ -f $PRE_START_PATH ] ; then - echo "Running script $PRE_START_PATH" - source $PRE_START_PATH -else - echo "There is no script $PRE_START_PATH" -fi - -# Start Supervisor, with Nginx and uWSGI -exec /usr/bin/supervisord diff --git a/python3.6-alpine3.7/Dockerfile b/python3.6-alpine3.7/Dockerfile index 69d55f36..e15cf22e 100644 --- a/python3.6-alpine3.7/Dockerfile +++ b/python3.6-alpine3.7/Dockerfile @@ -21,10 +21,6 @@ WORKDIR /app # Make /app/* available to be imported by Python globally to better support several use cases like Alembic migrations. ENV PYTHONPATH=/app -# Copy start.sh script that will check for a /app/prestart.sh script and run it before starting the app -COPY start.sh /start.sh -RUN chmod +x /start.sh - # Move the base entrypoint to reuse it RUN mv /entrypoint.sh /uwsgi-nginx-entrypoint.sh # Copy the entrypoint that will generate Nginx additional configs @@ -33,6 +29,7 @@ RUN chmod +x /entrypoint.sh ENTRYPOINT ["/entrypoint.sh"] -# Run the start script, it will check for an /app/prestart.sh script (e.g. for migrations) +# Run the start script provided by the parent image tiangolo/uwsgi-nginx. +# It will check for an /app/prestart.sh script (e.g. for migrations) # And then will start Supervisor, which in turn will start Nginx and uWSGI CMD ["/start.sh"] diff --git a/python3.6-alpine3.7/start.sh b/python3.6-alpine3.7/start.sh deleted file mode 100644 index 8626c151..00000000 --- a/python3.6-alpine3.7/start.sh +++ /dev/null @@ -1,15 +0,0 @@ -#! /usr/bin/env sh -set -e - -# If there's a prestart.sh script in the /app directory, run it before starting -PRE_START_PATH=/app/prestart.sh -echo "Checking for script in $PRE_START_PATH" -if [ -f $PRE_START_PATH ] ; then - echo "Running script $PRE_START_PATH" - source $PRE_START_PATH -else - echo "There is no script $PRE_START_PATH" -fi - -# Start Supervisor, with Nginx and uWSGI -exec /usr/bin/supervisord diff --git a/python3.6-alpine3.8/Dockerfile b/python3.6-alpine3.8/Dockerfile index 09ce3ecc..2d155747 100644 --- a/python3.6-alpine3.8/Dockerfile +++ b/python3.6-alpine3.8/Dockerfile @@ -21,10 +21,6 @@ WORKDIR /app # Make /app/* available to be imported by Python globally to better support several use cases like Alembic migrations. ENV PYTHONPATH=/app -# Copy start.sh script that will check for a /app/prestart.sh script and run it before starting the app -COPY start.sh /start.sh -RUN chmod +x /start.sh - # Move the base entrypoint to reuse it RUN mv /entrypoint.sh /uwsgi-nginx-entrypoint.sh # Copy the entrypoint that will generate Nginx additional configs @@ -33,6 +29,7 @@ RUN chmod +x /entrypoint.sh ENTRYPOINT ["/entrypoint.sh"] -# Run the start script, it will check for an /app/prestart.sh script (e.g. for migrations) +# Run the start script provided by the parent image tiangolo/uwsgi-nginx. +# It will check for an /app/prestart.sh script (e.g. for migrations) # And then will start Supervisor, which in turn will start Nginx and uWSGI CMD ["/start.sh"] diff --git a/python3.6-alpine3.8/start.sh b/python3.6-alpine3.8/start.sh deleted file mode 100644 index 8626c151..00000000 --- a/python3.6-alpine3.8/start.sh +++ /dev/null @@ -1,15 +0,0 @@ -#! /usr/bin/env sh -set -e - -# If there's a prestart.sh script in the /app directory, run it before starting -PRE_START_PATH=/app/prestart.sh -echo "Checking for script in $PRE_START_PATH" -if [ -f $PRE_START_PATH ] ; then - echo "Running script $PRE_START_PATH" - source $PRE_START_PATH -else - echo "There is no script $PRE_START_PATH" -fi - -# Start Supervisor, with Nginx and uWSGI -exec /usr/bin/supervisord diff --git a/python3.6/Dockerfile b/python3.6/Dockerfile index 40a46138..0f3b1e7c 100644 --- a/python3.6/Dockerfile +++ b/python3.6/Dockerfile @@ -21,10 +21,6 @@ WORKDIR /app # Make /app/* available to be imported by Python globally to better support several use cases like Alembic migrations. ENV PYTHONPATH=/app -# Copy start.sh script that will check for a /app/prestart.sh script and run it before starting the app -COPY start.sh /start.sh -RUN chmod +x /start.sh - # Move the base entrypoint to reuse it RUN mv /entrypoint.sh /uwsgi-nginx-entrypoint.sh # Copy the entrypoint that will generate Nginx additional configs @@ -33,6 +29,7 @@ RUN chmod +x /entrypoint.sh ENTRYPOINT ["/entrypoint.sh"] -# Run the start script, it will check for an /app/prestart.sh script (e.g. for migrations) +# Run the start script provided by the parent image tiangolo/uwsgi-nginx. +# It will check for an /app/prestart.sh script (e.g. for migrations) # And then will start Supervisor, which in turn will start Nginx and uWSGI CMD ["/start.sh"] diff --git a/python3.6/start.sh b/python3.6/start.sh deleted file mode 100644 index 81580305..00000000 --- a/python3.6/start.sh +++ /dev/null @@ -1,15 +0,0 @@ -#! /usr/bin/env bash -set -e - -# If there's a prestart.sh script in the /app directory, run it before starting -PRE_START_PATH=/app/prestart.sh -echo "Checking for script in $PRE_START_PATH" -if [ -f $PRE_START_PATH ] ; then - echo "Running script $PRE_START_PATH" - source $PRE_START_PATH -else - echo "There is no script $PRE_START_PATH" -fi - -# Start Supervisor, with Nginx and uWSGI -exec /usr/bin/supervisord diff --git a/python3.7-alpine3.7/Dockerfile b/python3.7-alpine3.7/Dockerfile index 4f5b0f2f..c734f455 100644 --- a/python3.7-alpine3.7/Dockerfile +++ b/python3.7-alpine3.7/Dockerfile @@ -21,10 +21,6 @@ WORKDIR /app # Make /app/* available to be imported by Python globally to better support several use cases like Alembic migrations. ENV PYTHONPATH=/app -# Copy start.sh script that will check for a /app/prestart.sh script and run it before starting the app -COPY start.sh /start.sh -RUN chmod +x /start.sh - # Move the base entrypoint to reuse it RUN mv /entrypoint.sh /uwsgi-nginx-entrypoint.sh # Copy the entrypoint that will generate Nginx additional configs @@ -33,6 +29,7 @@ RUN chmod +x /entrypoint.sh ENTRYPOINT ["/entrypoint.sh"] -# Run the start script, it will check for an /app/prestart.sh script (e.g. for migrations) +# Run the start script provided by the parent image tiangolo/uwsgi-nginx. +# It will check for an /app/prestart.sh script (e.g. for migrations) # And then will start Supervisor, which in turn will start Nginx and uWSGI CMD ["/start.sh"] diff --git a/python3.7-alpine3.7/start.sh b/python3.7-alpine3.7/start.sh deleted file mode 100644 index 8626c151..00000000 --- a/python3.7-alpine3.7/start.sh +++ /dev/null @@ -1,15 +0,0 @@ -#! /usr/bin/env sh -set -e - -# If there's a prestart.sh script in the /app directory, run it before starting -PRE_START_PATH=/app/prestart.sh -echo "Checking for script in $PRE_START_PATH" -if [ -f $PRE_START_PATH ] ; then - echo "Running script $PRE_START_PATH" - source $PRE_START_PATH -else - echo "There is no script $PRE_START_PATH" -fi - -# Start Supervisor, with Nginx and uWSGI -exec /usr/bin/supervisord diff --git a/python3.7-alpine3.8/Dockerfile b/python3.7-alpine3.8/Dockerfile index 7444b9e0..509d8306 100644 --- a/python3.7-alpine3.8/Dockerfile +++ b/python3.7-alpine3.8/Dockerfile @@ -21,10 +21,6 @@ WORKDIR /app # Make /app/* available to be imported by Python globally to better support several use cases like Alembic migrations. ENV PYTHONPATH=/app -# Copy start.sh script that will check for a /app/prestart.sh script and run it before starting the app -COPY start.sh /start.sh -RUN chmod +x /start.sh - # Move the base entrypoint to reuse it RUN mv /entrypoint.sh /uwsgi-nginx-entrypoint.sh # Copy the entrypoint that will generate Nginx additional configs @@ -33,6 +29,7 @@ RUN chmod +x /entrypoint.sh ENTRYPOINT ["/entrypoint.sh"] -# Run the start script, it will check for an /app/prestart.sh script (e.g. for migrations) +# Run the start script provided by the parent image tiangolo/uwsgi-nginx. +# It will check for an /app/prestart.sh script (e.g. for migrations) # And then will start Supervisor, which in turn will start Nginx and uWSGI CMD ["/start.sh"] diff --git a/python3.7-alpine3.8/start.sh b/python3.7-alpine3.8/start.sh deleted file mode 100644 index 8626c151..00000000 --- a/python3.7-alpine3.8/start.sh +++ /dev/null @@ -1,15 +0,0 @@ -#! /usr/bin/env sh -set -e - -# If there's a prestart.sh script in the /app directory, run it before starting -PRE_START_PATH=/app/prestart.sh -echo "Checking for script in $PRE_START_PATH" -if [ -f $PRE_START_PATH ] ; then - echo "Running script $PRE_START_PATH" - source $PRE_START_PATH -else - echo "There is no script $PRE_START_PATH" -fi - -# Start Supervisor, with Nginx and uWSGI -exec /usr/bin/supervisord diff --git a/python3.7/Dockerfile b/python3.7/Dockerfile index 18f7cb52..3b6345af 100644 --- a/python3.7/Dockerfile +++ b/python3.7/Dockerfile @@ -21,10 +21,6 @@ WORKDIR /app # Make /app/* available to be imported by Python globally to better support several use cases like Alembic migrations. ENV PYTHONPATH=/app -# Copy start.sh script that will check for a /app/prestart.sh script and run it before starting the app -COPY start.sh /start.sh -RUN chmod +x /start.sh - # Move the base entrypoint to reuse it RUN mv /entrypoint.sh /uwsgi-nginx-entrypoint.sh # Copy the entrypoint that will generate Nginx additional configs @@ -33,6 +29,7 @@ RUN chmod +x /entrypoint.sh ENTRYPOINT ["/entrypoint.sh"] -# Run the start script, it will check for an /app/prestart.sh script (e.g. for migrations) +# Run the start script provided by the parent image tiangolo/uwsgi-nginx. +# It will check for an /app/prestart.sh script (e.g. for migrations) # And then will start Supervisor, which in turn will start Nginx and uWSGI CMD ["/start.sh"] diff --git a/python3.7/start.sh b/python3.7/start.sh deleted file mode 100644 index 81580305..00000000 --- a/python3.7/start.sh +++ /dev/null @@ -1,15 +0,0 @@ -#! /usr/bin/env bash -set -e - -# If there's a prestart.sh script in the /app directory, run it before starting -PRE_START_PATH=/app/prestart.sh -echo "Checking for script in $PRE_START_PATH" -if [ -f $PRE_START_PATH ] ; then - echo "Running script $PRE_START_PATH" - source $PRE_START_PATH -else - echo "There is no script $PRE_START_PATH" -fi - -# Start Supervisor, with Nginx and uWSGI -exec /usr/bin/supervisord