Tommy Carpenter | 8984604 | 2018-06-26 22:19:08 -0400 | [diff] [blame] | 1 | FROM tiangolo/uwsgi-nginx-flask:python3.6 |
Tommy Carpenter | 0581c1e | 2017-08-11 15:02:32 -0400 | [diff] [blame] | 2 | MAINTAINER tommy@research.att.com |
| 3 | |
Tommy Carpenter | 8984604 | 2018-06-26 22:19:08 -0400 | [diff] [blame] | 4 | #setup uwsgi+nginx |
| 5 | # https://hub.docker.com/r/tiangolo/uwsgi-nginx-flask/ |
| 6 | COPY ./app /app |
Tommy Carpenter | 0581c1e | 2017-08-11 15:02:32 -0400 | [diff] [blame] | 7 | |
Tommy Carpenter | 8984604 | 2018-06-26 22:19:08 -0400 | [diff] [blame] | 8 | RUN pip install --upgrade pip |
| 9 | RUN pip install /app/app |
Tommy Carpenter | 0581c1e | 2017-08-11 15:02:32 -0400 | [diff] [blame] | 10 | |
Tommy Carpenter | 226719d | 2018-03-09 10:41:05 -0500 | [diff] [blame] | 11 | RUN mkdir -p /opt/logs/ |
| 12 | |
Tommy Carpenter | 0d2fdb1 | 2018-06-29 16:08:34 -0400 | [diff] [blame] | 13 | # create the dir for the ssl certs |
| 14 | RUN mkdir -p /etc/nginx/ssl |
| 15 | |
| 16 | COPY nginxhttps.conf /etc/nginx/conf.d/nginxhttps.conf |
| 17 | |
Tommy Carpenter | 9ab2e0b | 2018-07-25 08:49:20 -0400 | [diff] [blame] | 18 | #443 is https, 10000 is http |
| 19 | # in the future, hopefully http can go away completely |
Tommy Carpenter | 0d2fdb1 | 2018-06-29 16:08:34 -0400 | [diff] [blame] | 20 | ENV LISTEN_PORT 10000 |
| 21 | EXPOSE 443 |
| 22 | EXPOSE 10000 |
| 23 | |
Tommy Carpenter | 9ab2e0b | 2018-07-25 08:49:20 -0400 | [diff] [blame] | 24 | # Mount a self signed certificate that should be overwritten upon Run |
| 25 | RUN apt-get update && \ |
| 26 | apt-get install -y openssl && \ |
| 27 | openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/nginx/ssl/nginx.key -out /etc/nginx/ssl/nginx.crt -subj "/C=US/ST=NJ/L=foo/O=ONAP/OU=ONAP/CN=configbinding" |
| 28 | |
Tommy Carpenter | 0d2fdb1 | 2018-06-29 16:08:34 -0400 | [diff] [blame] | 29 | #this is a registrator flag that tells it to ignore 80 from service discovery. Nothing is listening on 80, but the parent Dockerfile here exposes it. This container is internally listening on 10000 and 443. |
| 30 | ENV SERVICE_80_IGNORE true |