-
-
Notifications
You must be signed in to change notification settings - Fork 27
/
Dockerfile
52 lines (42 loc) · 1.47 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
43
44
45
46
47
48
49
50
51
52
FROM arjunsalyan/macports-ubuntu:2.9.3
ARG USER=0:0
# Install required packages and remove the apt packages cache when done.
RUN apt-get update && \
apt-get upgrade -y && \
apt-get install -y \
git \
python3 \
python3-dev \
python3-setuptools \
python3-pip \
nginx \
cron \
rsync \
python-dev \
libpq-dev \
tcllib \
supervisor && \
pip3 install -U pip setuptools && \
rm -rf /var/lib/apt/lists/*
# 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 config/nginx.conf /etc/nginx/sites-available/default
COPY config/supervisor.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 app/requirements.txt /code/app/
RUN pip3 install -r /code/app/requirements.txt
# Setup cron
COPY config/crons /etc/cron.d/crons
RUN chmod 0644 /etc/cron.d/crons
# add (the rest of) our code
COPY . /code/
RUN touch /var/log/buildhistorycron.log
RUN touch /var/log/portinfocron.log
RUN chown -R ${USER} /var/log/buildhistorycron.log /var/log/portinfocron.log /var/log/supervisor /var/log/nginx /var/lib/nginx /code
RUN chown ${USER} /run
USER ${USER}
EXPOSE 8080
CMD ["/usr/bin/supervisord", "-n"]