-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile
47 lines (40 loc) · 1.05 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
FROM alpine
# Copy python requirements file
COPY requirements-api.txt /tmp/requirements.txt
# Add demo app
COPY ./ /app
RUN apk add --no-cache \
python3 \
python3-dev \
py-virtualenv \
py-pip \
git \
bash \
nginx \
postgresql-libs \
postgresql-dev \
musl-dev \
pcre \
pcre-dev \
uwsgi-python3 \
gcc \
libc-dev \
linux-headers \
supervisor && \
python3 -m ensurepip && \
rm /etc/nginx/conf.d/default.conf && \
rm -rf /etc/nginx/sites-available/default && \
rm -rf /etc/nginx/sites-available/default
# Copy the Flask Nginx site conf
COPY flask-site-nginx.conf /etc/nginx/sites-available/movieposters
# Copy the base uWSGI ini file to enable default dynamic uwsgi process number
COPY uwsgi.ini /etc/uwsgi/
# Custom Supervisord config
COPY supervisord.conf /etc/supervisord.conf
WORKDIR /app
RUN rm -r /usr/lib/python*/ensurepip && \
rm -rf env && \
virtualenv -p python3 env && \
source env/bin/activate && \
pip install -r /tmp/requirements.txt
CMD ["/usr/bin/supervisord"]