Add OpenFaaS Clear Linux based python3 template

Signed-off-by: Qi Zheng <qi.zheng@intel.com>
This commit is contained in:
Qi Zheng
2019-12-06 13:30:14 +08:00
committed by qzheng527
parent 8304a1e565
commit f5bd2001ba
10 changed files with 128 additions and 0 deletions
@@ -0,0 +1,46 @@
FROM openfaas/classic-watchdog:0.18.1 as watchdog
FROM clearlinux/python:3
ARG swupd_args
COPY --from=watchdog /fwatchdog /usr/bin/fwatchdog
RUN chmod +x /usr/bin/fwatchdog
WORKDIR /root/
COPY index.py .
# pip install python packages if required
COPY requirements.txt .
RUN pip install -r requirements.txt
# install bundles if required
# PLEASE input bundle line by line
COPY bundles.txt .
RUN for bundle in $(cat bundles.txt); do \
swupd bundle-add $bundle $swupd_args; \
done
RUN mkdir -p function
RUN touch ./function/__init__.py
WORKDIR /root/function/
# pip install python packages if required
COPY function/requirements.txt .
RUN pip install -r requirements.txt
# install bundles if required
# PLEASE input bundle line by line
COPY function/bundles.txt .
RUN for bundle in $(cat bundles.txt); do \
swupd bundle-add $bundle $swupd_args; \
done
WORKDIR /root/
COPY function function
ENV fprocess="python3 index.py"
EXPOSE 8080
HEALTHCHECK --interval=3s CMD [ -e /tmp/.lock ] || exit 1
CMD ["fwatchdog"]