qinling/runtimes/sidecar/Dockerfile
Lingxian Kong 05588c1957 Add sidecar support for runtime
Split function package download functionality into a separate
container, so that it will be easy to add additional runtime support.

I was planning to use kubernetes new verion apps api in qinling, but
failed because the kubernetes client in global requirement is not
updated yet, so I comment the code out in case we use them in future.

Change-Id: I0709b8ac689638b78e00ca35d0fea2db6cae0d0f
Story: 2001580
Task: 6607
2018-03-06 01:31:16 +00:00

23 lines
926 B
Docker

FROM alpine:3.7
MAINTAINER lingxian.kong@gmail.com
# We need to use qinling user to keep consistent with server.
USER root
RUN adduser -HDs /bin/sh qinling
RUN apk update && \
apk add --no-cache linux-headers build-base python2 python2-dev py2-pip uwsgi-python uwsgi-http && \
pip install --upgrade pip && \
rm -r /root/.cache
COPY . /sidecar
WORKDIR /sidecar
RUN pip install --no-cache-dir -r requirements.txt && \
mkdir -p /var/lock/qinling && \
mkdir -p /var/qinling/packages && \
chown -R qinling:qinling /sidecar /var/lock/qinling /var/qinling/packages
EXPOSE 9091
# uwsgi --plugin http,python --http :9091 --uid qinling --wsgi-file sidecar.py --callable app --master --processes 1 --threads 1
CMD ["/usr/sbin/uwsgi", "--plugin", "http,python", "--http", "127.0.0.1:9091", "--uid", "qinling", "--wsgi-file", "sidecar.py", "--callable", "app", "--master", "--processes", "1", "--threads", "1"]