Avinash commited on
Commit
c1fc2a9
·
1 Parent(s): 11064fa

init: worker docker skeleton

Browse files
Files changed (3) hide show
  1. Dockerfile +7 -0
  2. requirements.txt +0 -0
  3. worker.py +12 -0
Dockerfile ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ FROM python:3.11-slim
2
+ WORKDIR /app
3
+ COPY requirements.txt .
4
+ RUN pip install --no-cache-dir -r requirements.txt || true
5
+ COPY worker.py .
6
+ ENV POLL_INTERVAL_SECONDS=5
7
+ CMD ["python", "worker.py"]
requirements.txt ADDED
File without changes
worker.py ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import time, os
2
+
3
+ POLL = int(os.getenv("POLL_INTERVAL_SECONDS", "5"))
4
+
5
+ def main():
6
+ print("worker starting...")
7
+ while True:
8
+ print("tick")
9
+ time.sleep(POLL)
10
+
11
+ if __name__ == "__main__":
12
+ main()