-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
32 lines (23 loc) · 955 Bytes
/
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
FROM python:3.6-alpine3.9 as builder
COPY . work
WORKDIR /work
RUN echo "@edge http://dl-cdn.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories && \
apk update && apk upgrade && \
apk add --no-cache --virtual build-dependencies build-base && \
apk add --no-cache librdkafka-dev@edge~=1.1.0 && \
pip install --install-option="--prefix=/install" . && \
apk del build-dependencies
FROM python:3.6-alpine3.9
ENV HOME=/home/pyrandall
RUN echo "@edge http://dl-cdn.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories && \
apk update && apk upgrade && \
apk add --no-cache librdkafka@edge~=1.1.0 && \
apk add ca-certificates && rm -rf /var/cache/apk/* && \
addgroup -S -g 1000 pyrandall && \
adduser -D -S -u 1000 -G pyrandall -h $HOME pyrandall
COPY --from=builder /install /usr/local/
RUN update-ca-certificates
WORKDIR /home/pyrandall
USER pyrandall
COPY logging.yaml .
ENTRYPOINT ["pyrandall"]