AstraOS commited on
Commit
211082d
·
verified ·
1 Parent(s): 56dfcb2

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +8 -4
Dockerfile CHANGED
@@ -5,9 +5,13 @@ WORKDIR /build
5
  COPY requirements.txt .
6
  RUN pip install --prefix=/install -r requirements.txt
7
 
8
- COPY app.py .
9
- RUN python -m compileall -b -f app.py # → app.pyc
10
- RUN tar -czf /build/app.tgz app.pyc # bundle
 
 
 
 
11
 
12
  ################ runtime ################
13
  FROM python:3.9-slim
@@ -28,5 +32,5 @@ ENTRYPOINT ["bash", "-c", "\
28
  tar -xzf /tmp/runner/app.tgz -C /tmp/runner; \
29
  python /tmp/runner/app.pyc & pid=$!; \
30
  sleep 2; \
31
- rm -f /tmp/runner/app.pyc /tmp/runner/app.tgz; \
32
  wait $pid"]
 
5
  COPY requirements.txt .
6
  RUN pip install --prefix=/install -r requirements.txt
7
 
8
+ COPY app.py telegram_preview.py ./
9
+
10
+ # compile both files
11
+ RUN python -m compileall -b -f app.py telegram_preview.py # → app.pyc
12
+
13
+ # bundle both .pyc files together
14
+ RUN tar -czf /build/app.tgz app.pyc telegram_preview.pyc # bundle
15
 
16
  ################ runtime ################
17
  FROM python:3.9-slim
 
32
  tar -xzf /tmp/runner/app.tgz -C /tmp/runner; \
33
  python /tmp/runner/app.pyc & pid=$!; \
34
  sleep 2; \
35
+ rm -f /tmp/runner/app.pyc /tmp/runner/telegram_preview.pyc /tmp/runner/app.tgz; \
36
  wait $pid"]