forked from rh-messaging-qe/yacfg
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
44 lines (36 loc) · 988 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
33
34
35
36
37
38
39
40
41
42
43
44
FROM python:3.10.0-alpine3.14 AS base
FROM base AS builder
ENV PYTHONFAULTHANDLER=1 \
PYTHONUNBUFFERED=1 \
PYTHONHASHSEED=random \
PIP_NO_CACHE_DIR=off \
PIP_DISABLE_PIP_VERSION_CHECK=on \
PIP_DEFAULT_TIMEOUT=100 \
POETRY_NO_INTERACTION=1 \
POETRY_VIRTUALENVS_CREATE=false \
PATH="$PATH:/runtime/bin" \
PYTHONPATH="$PYTHONPATH:/runtime/lib/python3.9/site-packages"
RUN apk add --no-cache \
build-base \
curl \
gcc \
libressl-dev \
musl-dev \
libffi-dev \
libzmq \
zeromq-dev
RUN pip install --no-cache-dir --upgrade pip setuptools wheel poetry
COPY . /src
WORKDIR /src
RUN poetry build
RUN pip install --prefix=/runtime --force-reinstall dist/*.whl
FROM base AS runtime
COPY --from=builder /runtime /usr/local
RUN mkdir -p /data/output && \
addgroup -S yacfg && \
adduser -S -D -h /data yacfg yacfg && \
chown -R yacfg:yacfg /data
USER yacfg
WORKDIR /data
VOLUME [ "/data/output" ]
CMD ["yacfg", "--help"]