-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathDockerfile
33 lines (21 loc) · 1.09 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
FROM vmware/photon2:20180424
RUN tdnf install -y python3-3.6.5-1.ph2 python3-pip-3.6.5-1.ph2 gzip tar && pip3 install --upgrade pip setuptools
ARG IMAGE_TEMPLATE=/image-template
ARG FUNCTION_TEMPLATE=/function-template
ARG servers=1
LABEL io.dispatchframework.imageTemplate="${IMAGE_TEMPLATE}" \
io.dispatchframework.functionTemplate="${FUNCTION_TEMPLATE}"
COPY image-template ${IMAGE_TEMPLATE}/
COPY function-template ${FUNCTION_TEMPLATE}/
COPY validator /validator/
COPY function-server /function-server/
RUN pip install -r /function-server/requirements.txt
## Set WORKDIR, PORT and SERVER_CMD, expose $PORT, cd to $WORKDIR
ENV WORKDIR=/function PORT=8080 SERVERS=$servers FUNKY_VERSION=0.1.2
EXPOSE ${PORT}
WORKDIR ${WORKDIR}
RUN curl -L https://github.com/dispatchframework/funky/releases/download/${FUNKY_VERSION}/funky${FUNKY_VERSION}.linux-amd64.tgz -o funky${FUNKY_VERSION}.linux-amd64.tgz
RUN tar -xzf funky${FUNKY_VERSION}.linux-amd64.tgz
# OpenFaaS readiness check depends on this file
RUN touch /tmp/.lock
CMD SERVER_CMD="python3 /function-server/main.py $(cat /tmp/handler)" ./funky