-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
28 lines (19 loc) · 777 Bytes
/
Dockerfile
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
FROM alpine/git:latest AS builder
WORKDIR /app
COPY . /app
RUN \
echo "$(git describe --tags --always)@$(git branch --show-current)" | tee .version ; \
if test $(expr length "$(cat .version)") -le 3; then echo "dirty-build@$(date -Iseconds)" | tee .version; else echo "build@$(date -Iseconds)" | tee -a .version; fi ; \
rm -rf .git .github resources && \
mkdir -p config
#----------------------------------------
FROM python:3.9-slim
WORKDIR /app
COPY --from=builder /app /app
RUN \
apt-get update && apt-get install -y gcc g++ && \
pip install --trusted-host pypi.python.org --no-cache-dir -r /app/requirements.txt && \
apt-get purge -y gcc g++ && apt-get autoremove --purge -y && \
ls -la ; \
cat .version
CMD ["python", "-u", "telegramRSSbot.py"]