mail-forwarder/Dockerfile

31 lines
870 B
Docker
Raw Normal View History

2024-08-04 15:58:39 +00:00
# Dockerfile References: https://docs.docker.com/engine/reference/builder/
# Start from python:3.9-alpine base image
FROM python:3.9-alpine
ENV PYTHONFAULTHANDLER=1 \
PYTHONUNBUFFERED=1 \
PYTHONHASHSEED=random \
PIP_NO_CACHE_DIR=off \
PIP_DISABLE_PIP_VERSION_CHECK=on \
PIP_DEFAULT_TIMEOUT=100 \
POETRY_VERSION=1.1.13
RUN apk add --no-cache curl
RUN curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python -
ENV PATH="/root/.poetry/bin:${PATH}"
# Make dir app
WORKDIR /app
COPY poetry.lock pyproject.toml /app/
# Project initialization:
RUN poetry config virtualenvs.create false \
&& poetry install --no-dev --no-interaction --no-ansi
# Copy the source from the current directory to the Working Directory inside the container
COPY . /app
# Run the executable
CMD ["poetry", "run", "python", "mail-forwarder"]