-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.celery
37 lines (23 loc) · 898 Bytes
/
Dockerfile.celery
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
#Use a imagem base do Python
FROM python:3.12 AS builder
WORKDIR /app
RUN pip install poetry==1.8.3
ENV POETRY_NO_INTERACTION=1 \
POETRY_VIRTUALENVS_IN_PROJECT=1 \
POETRY_VIRTUALENVS_CREATE=1 \
POETRY_CACHE_DIR=/tmp/poetry_cache
COPY pyproject.toml poetry.lock ./
RUN poetry install
FROM python:3.12-slim AS runtime
RUN useradd --create-home --home-dir /home/appuser appuser
ENV VIRTUAL_ENV=/app/.venv \
PATH="/app/.venv/bin:$PATH"
COPY --from=builder ${VIRTUAL_ENV} ${VIRTUAL_ENV}
COPY . .
# Altere a propriedade dos arquivos para o novo usuário
RUN chown -R appuser:appuser /app
USER appuser
# EXPOSE 8000
# CMD ["uvicorn", "src.app_module:http_server", "--host", "0.0.0.0", "--port", "8000", "--reload"]
# celery -A akashi worker --loglevel=DEBUG -E --concurrency 1
CMD ["celery", "-A", "src.apps.tasks.tasks_service", "worker", "--loglevel=INFO", "-E", "--concurrency", "1"]