Ubuntu-Ansible-Setup/Dockerfile

47 lines
788 B
Docker
Raw Normal View History

2023-01-26 00:53:18 -06:00
# syntax=docker/dockerfile:1.4
# hadolint global ignore=DL3003,DL3008
FROM python:3.11-alpine3.17 as base
ENV PYTHONFAULTHANDLER=1 \
PYTHONHASHSEED=random \
PYTHONUNBUFFERED=1
WORKDIR /app
FROM base as build
ENV PIP_DEFAULT_TIMEOUT=100 \
PIP_DISABLE_PIP_VERSION_CHECK=1 \
2023-07-20 20:24:03 -05:00
PIP_NO_CACHE_DIR=1
2023-01-26 00:53:18 -06:00
2023-07-20 20:24:03 -05:00
RUN pip install "poetry"
2023-01-26 00:53:18 -06:00
COPY pyproject.toml poetry.lock ./
2023-01-26 00:53:18 -06:00
RUN <<__EOR__
poetry config virtualenvs.in-project true
2023-01-31 18:39:00 -06:00
poetry install --only=main,dev --no-root --no-ansi --no-interaction
2023-01-26 00:53:18 -06:00
__EOR__
FROM base as final
RUN <<__EOR__
apk add --no-cache \
2023-05-16 11:37:55 -05:00
openssh-client \
ca-certificates
2023-01-26 00:53:18 -06:00
__EOR__
COPY --from=build /app/.venv ./.venv
COPY . .
ENV PATH="${PATH}:/app/.venv/bin"
2023-01-27 16:24:47 -06:00
RUN <<__EOR__
ansible-galaxy install -r requirements.yml
__EOR__
2023-01-27 15:06:41 -06:00
ENTRYPOINT [ "/bin/sh" ]