-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
45 lines (36 loc) · 1.06 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
# start with a base image
# FROM ubuntu:16.04
FROM python:3.5-slim
# install dependencies
RUN apt-get update && apt-get install -y \
apt-utils \
build-essential \
nginx \
libpq-dev \
supervisor \
python3-pip \
python3-dev \
git \
&& rm -rf /var/lib/apt/lists/*
RUN echo "America/New_York" > /etc/timezone; dpkg-reconfigure -f noninteractive tzdata
# update working directories
COPY ./app /app
COPY ./config /config
COPY requirements.txt /
# install dependencies
RUN pip install --upgrade pip
RUN pip3 install -r requirements.txt
# install brotli
#RUN git clone https://github.com/indygreg/python-zstandard.git \
# && cd python-zstandard \
# && python setup.py build_ext
RUN groupadd -r swuser -g 433 && \
useradd -u 431 -r -g swuser -d /app -s /sbin/nologin -c "Docker image user" swuser && \
chown -R swuser:swuser /app
# setup config
RUN echo "\ndaemon off;" >> /etc/nginx/nginx.conf
RUN rm /etc/nginx/sites-enabled/default
RUN ln -s /config/nginx.conf /etc/nginx/sites-enabled/
RUN ln -s /config/supervisor.conf /etc/supervisor/conf.d/
EXPOSE 80
CMD ["supervisord", "-n"]