-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
42 lines (32 loc) · 1.07 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
34
35
36
37
38
39
40
41
42
# syntax=docker/dockerfile:1
FROM python:3-alpine as build-stage
RUN mkdir /svc
WORKDIR /svc
COPY requirements.txt /svc
# Install required apk packages
RUN echo "***** Getting required packages *****" && \
apk add --no-cache --update \
gcc \
musl-dev \
linux-headers \
python3-dev \
g++ \
git && \
pip install --upgrade pip
# Build dependencies
RUN echo "***** Building dependencies *****" && \
pip wheel -r /svc/requirements.txt --wheel-dir=/svc/wheels
FROM python:3-alpine as application
ENV PYTHONUNBUFFERED=TRUE
# Get build-stage files
COPY --link --from=build-stage /svc /usr/src/app
WORKDIR /usr/src/app
RUN echo "***** Installing dependencies *****" && \
pip install --no-index --find-links=/usr/src/app/wheels -r requirements.txt
# Setup app
COPY --chmod=0755 . .
EXPOSE 5000
STOPSIGNAL SIGKILL
CMD [ "/usr/src/app/daemon.sh" ]
VOLUME /usr/src/app/bibles/json-bibles
HEALTHCHECK --interval=30s --timeout=30s --start-period=10s --retries=3 CMD wget http://0.0.0.0:5000/health -q -O - > /dev/null 2>&1 && echo "Healthy" || echo "Unhealthy"