summaryrefslogtreecommitdiffstats
path: root/docker
diff options
context:
space:
mode:
Diffstat (limited to 'docker')
-rw-r--r--docker/Dockerfile20
-rw-r--r--docker/Dockerfile.Base39
-rw-r--r--docker/docker-entrypoint.sh10
3 files changed, 69 insertions, 0 deletions
diff --git a/docker/Dockerfile b/docker/Dockerfile
new file mode 100644
index 0000000..fbfa7df
--- /dev/null
+++ b/docker/Dockerfile
@@ -0,0 +1,20 @@
+FROM onap/dcae-tosca-base:1.0.4
+
+RUN apk add --no-cache \
+ curl \
+ && :
+
+COPY ./app /srv/
+
+COPY ./docker/docker-entrypoint.sh /srv/
+
+COPY ./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/uwsgi", "--ini", "/srv/web/uwsgi.ini"]
diff --git a/docker/Dockerfile.Base b/docker/Dockerfile.Base
new file mode 100644
index 0000000..0f3b85d
--- /dev/null
+++ b/docker/Dockerfile.Base
@@ -0,0 +1,39 @@
+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 \
+ 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
+
+RUN apk del \
+ autoconf \
+ gcc \
+ libc-dev \
+ linux-headers \
+ && :
+
diff --git a/docker/docker-entrypoint.sh b/docker/docker-entrypoint.sh
new file mode 100644
index 0000000..42fe60b
--- /dev/null
+++ b/docker/docker-entrypoint.sh
@@ -0,0 +1,10 @@
+#!/bin/sh
+set -x
+echo "Running entry point"
+echo $@
+## Run nginxi Web Server
+/usr/sbin/nginx -c /etc/nginx/nginx.conf
+
+# Execute arguments
+echo >&2 $0: Continuing with "$@"...
+exec "$@"