├── 3.4.2-aws-eb-onbuild ├── Dockerfile └── uwsgi-start.sh ├── LICENSE.txt ├── NOTICE.txt └── README.md /3.4.2-aws-eb-onbuild/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM python:3.4.2 2 | 3 | WORKDIR /var/app 4 | 5 | RUN pip3 install virtualenv 6 | RUN virtualenv /var/app 7 | RUN /var/app/bin/pip install --download-cache /src uwsgi 8 | 9 | RUN useradd uwsgi -s /bin/false 10 | RUN mkdir /var/log/uwsgi 11 | RUN chown -R uwsgi:uwsgi /var/log/uwsgi 12 | 13 | ONBUILD ADD . /var/app 14 | ONBUILD RUN if [ -f /var/app/requirements.txt ]; then /var/app/bin/pip install -r /var/app/requirements.txt; fi 15 | 16 | ENV UWSGI_NUM_PROCESSES 1 17 | ENV UWSGI_NUM_THREADS 15 18 | ENV UWSGI_UID uwsgi 19 | ENV UWSGI_GID uwsgi 20 | ENV UWSGI_LOG_FILE /var/log/uwsgi/uwsgi.log 21 | 22 | EXPOSE 8080 23 | 24 | ADD uwsgi-start.sh / 25 | 26 | CMD [] 27 | ENTRYPOINT ["/uwsgi-start.sh"] 28 | -------------------------------------------------------------------------------- /3.4.2-aws-eb-onbuild/uwsgi-start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | cd /var/app 4 | 5 | . bin/activate 6 | 7 | # Django support 8 | if cat requirements.txt | grep -q -i Django && [ -z "$WSGI_PATH" ]; then 9 | WSGI_PATH=`find /var/app | egrep '/var/app/[^/]+/wsgi.py'` 10 | fi 11 | 12 | # Flask support 13 | if cat requirements.txt | grep -q -i Flask && [ -z "$WSGI_MODULE" ]; then 14 | WSGI_MODULE=application:app 15 | fi 16 | 17 | [ -n "$WSGI_MODULE" ] && UWSGI_MODULE="--module $WSGI_MODULE" 18 | 19 | # defaulting to application.py if not explicitly set 20 | [ -z "$WSGI_PATH" ] && WSGI_PATH=application.py 21 | 22 | uwsgi --http :8080 --chdir /var/app --wsgi-file $WSGI_PATH $UWSGI_MODULE --master --processes $UWSGI_NUM_PROCESSES --threads $UWSGI_NUM_THREADS --uid $UWSGI_UID --gid $UWSGI_GID --logto2 $UWSGI_LOG_FILE 23 | 24 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright 2014 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"). You 4 | may not use this file except in compliance with the License. A copy of 5 | the License is located at 6 | 7 | http://aws.amazon.com/apache2.0/ 8 | 9 | or in the "license" file accompanying this file. This file is 10 | distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF 11 | ANY KIND, either express or implied. See the License for the specific 12 | language governing permissions and limitations under the License. 13 | 14 | ********************** 15 | THIRD PARTY COMPONENTS 16 | ********************** 17 | 18 | PSF LICENSE AGREEMENT FOR PYTHON 3.4.2 19 | 20 | This LICENSE AGREEMENT is between the Python Software Foundation (“PSF”), and the Individual or Organization (“Licensee”) accessing and otherwise using Python 3.4.2 software in source or binary form and its associated documentation. 21 | Subject to the terms and conditions of this License Agreement, PSF hereby grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce, analyze, test, perform and/or display publicly, prepare derivative works, distribute, and otherwise use Python 3.4.2 alone or in any derivative version, provided, however, that PSF’s License Agreement and PSF’s notice of copyright, i.e., “Copyright © 2001-2014 Python Software Foundation; All Rights Reserved” are retained in Python 3.4.2 alone or in any derivative version prepared by Licensee. 22 | In the event Licensee prepares a derivative work that is based on or incorporates Python 3.4.2 or any part thereof, and wants to make the derivative work available to others as provided herein, then Licensee hereby agrees to include in any such work a brief summary of the changes made to Python 3.4.2. 23 | PSF is making Python 3.4.2 available to Licensee on an “AS IS” basis. PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON 3.4.2 WILL NOT INFRINGE ANY THIRD PARTY RIGHTS. 24 | PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON 3.4.2 FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON 3.4.2, OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. 25 | This License Agreement will automatically terminate upon a material breach of its terms and conditions. 26 | Nothing in this License Agreement shall be deemed to create any relationship of agency, partnership, or joint venture between PSF and Licensee. This License Agreement does not grant permission to use PSF trademarks or trade name in a trademark sense to endorse or promote products or services of Licensee, or any third party. 27 | By copying, installing or otherwise using Python 3.4.2, Licensee agrees to be bound by the terms and conditions of this License Agreement. 28 | -------------------------------------------------------------------------------- /NOTICE.txt: -------------------------------------------------------------------------------- 1 | ********************** 2 | THIRD PARTY COMPONENTS 3 | ********************** 4 | This software includes third party software subject to the following copyrights: 5 | 6 | -Python 3 – Copyright © 2001-2014 Python Software Foundation; All Rights Reserved 7 | 8 | The licenses for these third party components are included in LICENSE.txt. 9 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | #aws-eb-python-dockerfiles 2 | 3 | #####This is the Python Dockerfile repository for AWS Elastic Beanstalk. 4 | 5 | See also 6 | 7 | ##LICENSE 8 | 9 | Copyright 2014 Amazon.com, Inc. or its affiliates. All Rights Reserved. 10 | 11 | Licensed under the Apache License, Version 2.0 (the "License"). 12 | You may not use this file except in compliance with the License. 13 | A copy of the License is located at 14 | 15 | http://aws.amazon.com/apache2.0/ 16 | 17 | or in the "license" file accompanying this file. This file is 18 | distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS 19 | OF ANY KIND, either express or implied. See the License for the 20 | specific language governing permissions and limitations under the 21 | License. 22 | --------------------------------------------------------------------------------