-
Notifications
You must be signed in to change notification settings - Fork 59
Expand file tree
/
Copy pathDockerfile.compute_worker
More file actions
33 lines (27 loc) · 1.16 KB
/
Dockerfile.compute_worker
File metadata and controls
33 lines (27 loc) · 1.16 KB
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
FROM --platform=linux/amd64 fedora:42
# This makes output not buffer and return immediately, nice for seeing results in stdout
ENV PYTHONUNBUFFERED 1
# Install Docker
RUN dnf -y install dnf-plugins-core && \
dnf-3 config-manager --add-repo https://download.docker.com/linux/fedora/docker-ce.repo && \
dnf -y update && \
dnf install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin && \
dnf install -y python3.9 && \
dnf clean all && \
rm -rf /var/cache /var/log/dnf* /var/log/yum.*
RUN curl -sSL https://install.python-poetry.org | python3.9 - --version 1.8.3
# Poetry location so future commands (below) work
ENV PATH $PATH:/root/.local/bin
# Want poetry to use system python of docker container
RUN poetry config virtualenvs.create false
RUN poetry config virtualenvs.in-project false
COPY ./compute_worker/pyproject.toml ./
COPY ./compute_worker/poetry.lock ./
# To use python3.9 instead of system python
RUN poetry config virtualenvs.prefer-active-python true && poetry install
ADD compute_worker .
CMD celery -A compute_worker worker \
-l info \
-Q compute-worker \
-n compute-worker@%n \
--concurrency=1