-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
42 lines (30 loc) · 1.62 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
FROM ubuntu:14.04
MAINTAINER Kate Heddleston <[email protected]>
RUN DEBIAN_FRONTEND=noninteractive apt-get update --fix-missing && apt-get install -y build-essential git python python-dev python-setuptools nginx supervisor bcrypt libssl-dev libffi-dev libpq-dev vim rsyslog wget libjpeg-dev libpng-dev
RUN easy_install pip
# stop supervisor service as we'll run it manually
RUN service supervisor stop
RUN mkdir /var/log/gunicorn && mkdir /var/log/deploys
RUN echo "daemon off;" >> /etc/nginx/nginx.conf
RUN rm /etc/nginx/sites-enabled/default
RUN mkdir /opt/code
# Add logging conf file
RUN wget -O ./remote_syslog.tar.gz https://github.com/papertrail/remote_syslog2/releases/download/v0.17/remote_syslog_linux_amd64.tar.gz && tar xzf ./remote_syslog.tar.gz && cp ./remote_syslog/remote_syslog /usr/bin/remote_syslog && rm ./remote_syslog.tar.gz && rm -rf ./remote_syslog/
# For all of the COPY commands commented out below, you can add these in through the Opsolutley UI instead of building them into the container
# Add remote syslog config files;
# COPY ./docker_files/log_files.yml /etc/log_files.yml
# Add service.conf
# COPY ./docker_files/service.conf /opt/code/
# RUN ln -s /opt/code/service.conf /etc/nginx/sites-enabled/
# Add supervisor
# COPY ./docker_files/supervisord.conf /opt/code/
# RUN ln -s /opt/code/supervisord.conf /etc/supervisor/conf.d/
# Add requirements and install
COPY ./docker_files/requirements.txt /opt/code/
RUN pip install -r /opt/code/requirements.txt
# Add github repo code to code file
COPY . /opt/code/
WORKDIR /opt/code
# expose port(s)
EXPOSE 80
CMD supervisord -c /etc/supervisor/conf.d/supervisord.conf