-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.executor
More file actions
42 lines (35 loc) · 1.44 KB
/
Dockerfile.executor
File metadata and controls
42 lines (35 loc) · 1.44 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
34
35
36
37
38
39
40
41
42
FROM python:3.12-slim-bookworm
SHELL ["/bin/sh", "-lc"]
# ---- System deps ----
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates curl \
&& rm -rf /var/lib/apt/lists/*
# ---- Install Docker CLI (static binary) ----
# Pick a known-good version. Change if you want.
ARG DOCKER_CLI_VERSION=27.5.1
RUN arch="$(uname -m)"; \
case "$arch" in \
x86_64) DARCH="x86_64" ;; \
aarch64) DARCH="aarch64" ;; \
*) echo "Unsupported arch: $arch" && exit 1 ;; \
esac; \
curl -fsSL "https://download.docker.com/linux/static/stable/${DARCH}/docker-${DOCKER_CLI_VERSION}.tgz" -o /tmp/docker.tgz; \
tar -xzf /tmp/docker.tgz -C /tmp; \
install -m 0755 /tmp/docker/docker /usr/local/bin/docker; \
rm -rf /tmp/docker /tmp/docker.tgz; \
command -v docker && docker --version
# ---- Install Docker Compose v2 plugin ----
ARG DOCKER_COMPOSE_VERSION=v2.27.0
RUN mkdir -p /usr/local/lib/docker/cli-plugins \
&& curl -fsSL "https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-linux-x86_64" \
-o /usr/local/lib/docker/cli-plugins/docker-compose \
&& chmod +x /usr/local/lib/docker/cli-plugins/docker-compose \
&& docker compose version
# ---- App ----
WORKDIR /app
COPY requirements.txt /app/requirements.txt
RUN pip install --no-cache-dir -r /app/requirements.txt
COPY . /app
ENV PYTHONPATH=/app
ENV PYTHONUNBUFFERED=1
CMD ["python", "-u", "executor_worker.py"]