Skip to content

Commit f3a230b

Browse files
committed
Add dockerfile.
1 parent 1c848ca commit f3a230b

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

Dockerfile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
FROM python:3.9-slim
2+
ENV PYTHONPATH=/bot PYTHONUNBUFFERED=1
3+
WORKDIR /bot
4+
5+
COPY . .
6+
7+
RUN set -x \
8+
&& adduser --system --group --home "$PWD" --shell /bin/sh --no-create-home --disabled-password bot-user \
9+
&& chown -R bot-user:bot-user . \
10+
&& su bot-user -c "python3 -m venv venv" \
11+
&& su bot-user -c "venv/bin/pip install --upgrade pip wheel" \
12+
&& su bot-user -c "venv/bin/pip install --requirement requirements.txt" \
13+
&& rm -rf .cache
14+
15+
USER bot-user
16+
ENTRYPOINT ["/bot/venv/bin/python", "bot.py"]

0 commit comments

Comments
 (0)