-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdockerfile
More file actions
34 lines (27 loc) · 1.3 KB
/
Copy pathdockerfile
File metadata and controls
34 lines (27 loc) · 1.3 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
FROM python:3.11-slim
WORKDIR /app
# Copy and install dependencies
COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt
# Copy application code into worker_versioning package
# This creates /app/worker_versioning/ directory structure
COPY . ./worker_versioning/
# Environment variables (will be overridden by K8s)
ENV TEMPORAL_ADDRESS="localhost:7233"
ENV TEMPORAL_NAMESPACE="default"
ENV TEMPORAL_TASK_QUEUE="worker-versioning"
# Worker versioning - these are injected by Temporal Worker Controller
# TEMPORAL_WORKER_BUILD_ID - Set by TWC or via env var
# TEMPORAL_DEPLOYMENT_NAME - Set by TWC or via env var
ENV TEMPORAL_WORKER_BUILD_ID="1.0"
ENV TEMPORAL_DEPLOYMENT_NAME="my-deployment"
# Run the unified worker (Approach 2: Environment-Driven)
# The same image works for all versions - Build ID is set via environment
CMD ["python", "-m", "worker_versioning.worker"]
# ============================================================================
# ALTERNATIVE: Approach 1 (Separate Worker Files)
# Uncomment below and comment out the CMD above to use separate worker files
# ============================================================================
# ARG WORKER_MODULE=workerv1
# ENV WORKER_MODULE=${WORKER_MODULE}
# CMD python -m worker_versioning.${WORKER_MODULE}