summaryrefslogtreecommitdiffstats
path: root/docker
diff options
context:
space:
mode:
authorAreli, Fuss (af732p) <af732p@intl.att.com>2018-09-12 16:28:11 +0300
committerAreli, Fuss (af732p) <af732p@intl.att.com>2018-09-12 16:29:14 +0300
commit898f70552e8fa936df88bd4bc405f8f39e5c32f7 (patch)
tree0322366a67c486040209aad2a220d2ebe5c330fe /docker
parent8055d8cb676d8df36f8a616f3e296720e68f82c5 (diff)
Add docker and replace application server
DCAE TOSCA APP add docker creation and replace application server Change-Id: I5d79994cb6b5b8bf18399ff65cbcfc84e6ec3958 Issue-ID: SDC-1756 Signed-off-by: Areli, Fuss (af732p) <af732p@intl.att.com>
Diffstat (limited to 'docker')
-rw-r--r--docker/Dockerfile34
-rw-r--r--docker/Dockerfile.Base33
2 files changed, 37 insertions, 30 deletions
diff --git a/docker/Dockerfile b/docker/Dockerfile
index fbfa7df..fcbf836 100644
--- a/docker/Dockerfile
+++ b/docker/Dockerfile
@@ -1,14 +1,34 @@
-FROM onap/dcae-tosca-base:1.0.4
-
-RUN apk add --no-cache \
+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 \
&& :
-COPY ./app /srv/
+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
+
+COPY app /srv/
-COPY ./docker/docker-entrypoint.sh /srv/
+COPY docker/docker-entrypoint.sh /srv/
-COPY ./nginx/nginx.conf /etc/nginx/nginx.conf
+COPY nginx/nginx.conf /etc/nginx/nginx.conf
RUN chmod +x /srv/tosca_server.py && \
chmod +x /srv/docker-entrypoint.sh
@@ -17,4 +37,4 @@ RUN pip3 install -r /srv/requirements.txt
EXPOSE 8085
-ENTRYPOINT ["/srv/docker-entrypoint.sh", "/usr/local/bin/uwsgi", "--ini", "/srv/web/uwsgi.ini"]
+ENTRYPOINT ["/srv/docker-entrypoint.sh", "/usr/local/bin/gunicorn", "-c", "/srv/web/gunicorn.conf" , "tosca_server:application"]
diff --git a/docker/Dockerfile.Base b/docker/Dockerfile.Base
index 0f3b85d..ec58e92 100644
--- a/docker/Dockerfile.Base
+++ b/docker/Dockerfile.Base
@@ -1,34 +1,15 @@
FROM python:3.5-alpine
-ENV http_proxy http://one.proxy.att.com:8080
-ENV https_proxy http://one.proxy.att.com:8080
-ENV GROUPID=1000 \
- USERNAME=dcae \
- USERID=1001 \
- USER_HOME=/home/dcae
-
-RUN apk add --no-cache \
+RUN apk add --update --no-cache \
autoconf \
gcc \
libc-dev \
linux-headers \
nginx \
- && :
-
-RUN pip install --upgrade setuptools && \
- pip install uwsgi==2.0.15
-
-RUN mkdir -p \
- /var/log/uwsgi \
- /run/uwsgi \
- /srv
-
-RUN addgroup -g ${GROUPID} -S ${USERNAME}
-
-RUN adduser -S -G ${USERNAME} -u ${USERID} -s /bin/bash -h ${USER_HOME} ${USERNAME}
-
-RUN chown ${USERNAME}:nginx /run/uwsgi
+ curl \
+ && pip install --upgrade setuptools \
+ && pip install gunicorn
RUN apk del \
autoconf \
@@ -37,3 +18,9 @@ RUN apk del \
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