summaryrefslogtreecommitdiffstats
path: root/docker/Dockerfile
blob: 757a602daac5c4df01204998382a931f7747708b (plain)
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 python:3.5-alpine

RUN apk add --update --no-cache \
    autoconf \
    gcc \
    libc-dev \
    linux-headers \
    nginx \
    curl \
    && pip install --upgrade setuptools \
    && pip install gunicorn

RUN apk del \
    autoconf \
    gcc \
    libc-dev \
    linux-headers \
    && :

RUN mkdir -p /run/nginx /run/gunicorn && \
    touch /run/nginx/nginx.pid && \
    chown -R nginx:nginx /var/log/nginx /run/nginx /run/gunicorn && \
    chmod 0775 /var/log/nginx && \
    chmod 0770 /var/lib/nginx/tmp /run/gunicorn && \
    chmod 0664 /run/nginx/nginx.pid

USER nginx

COPY --chown=nginx:nginx app /srv/

COPY --chown=nginx:nginx docker/docker-entrypoint.sh /srv/

COPY --chown=nginx:nginx nginx/nginx.conf /etc/nginx/nginx.conf

RUN chmod +x /srv/tosca_server.py && \
    chmod +x /srv/docker-entrypoint.sh

RUN pip3 install -r /srv/requirements.txt

EXPOSE 8085 

ENTRYPOINT ["/srv/docker-entrypoint.sh", "/usr/local/bin/gunicorn", "-c", "/srv/web/gunicorn.conf" , "tosca_server:application"]