maestro-server/report-app

View on GitHub
DockerfileCelery

Summary

Maintainability
Test Coverage
FROM maestroserver/maestro-python-gcc AS compile-graviz

RUN apt-get -y update --allow-releaseinfo-change && \
    apt-get -y install --no-install-recommends \
    pkg-config \
    graphviz-dev \
    && rm -rf /var/lib/apt/lists/*

ENV PYTHONDONTWRITEBYTECODE=1
WORKDIR /opt/application

RUN python3 -m venv /home/app/venv
ENV PATH="/home/app/venv/bin:$PATH"

COPY requirements.txt requirements.txt
RUN pip3 install --upgrade pip && \
    pip3 install --no-cache-dir -r requirements.txt


# production image
FROM python:3.8-slim
RUN useradd --create-home app

COPY --from=compile-graviz /home/app/venv /home/app/venv

ENV PATH="/home/app/venv/bin:$PATH"

WORKDIR /home/app
USER app

COPY ./ ./

CMD ["celery", "-A", "app.celery", "worker", "-l", "info"]