maestro-server/discovery-api

View on GitHub
DockerfileCelery

Summary

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

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-gcc /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"]