arrowcounter/Dockerfile

49 lines
1.5 KiB
Docker
Raw Normal View History

2018-08-10 11:44:52 +00:00
# Original file from: https://github.com/dockerfiles/django-uwsgi-nginx
# Copyright 2013 Thatcher Peskens
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
FROM alpine:3.8
MAINTAINER Dockerfiles
# Install required packages and remove the apt packages cache when done.
RUN apk add -y
git \
python3 \
python3-dev \
nginx \
supervisor \
pip3 install -U pip setuptools
# install uwsgi now because it takes a little while
RUN pip3 install uwsgi
# setup all the configfiles
RUN echo "daemon off;" >> /etc/nginx/nginx.conf
COPY nginx-app.conf /etc/nginx/sites-available/default
COPY supervisor-app.conf /etc/supervisor/conf.d/
# COPY requirements.txt and RUN pip install BEFORE adding the rest of your code, this will cause Docker's caching mechanism
# to prevent re-installing (all your) dependencies when you made a change a line or two in your app.
COPY requirements.txt /home/docker/code/
RUN pip3 install -r /home/docker/code/requirements.txt
# add (the rest of) our code
COPY . /home/docker/code/
EXPOSE 80
CMD ["supervisord", "-n"]