Dockerfile: bump python from 3.7-slim to 3.9-slim

This commit is contained in:
Rongrong 2021-09-30 01:15:39 +08:00
parent 8b10984629
commit 7523de8ee8
No known key found for this signature in database
GPG Key ID: A36C9CDA260CB264
2 changed files with 4 additions and 12 deletions

View File

@ -1,16 +1,9 @@
# Use an official Python runtime as a parent image FROM python:3.9-slim
FROM python:3.7-slim
# Set the working directory to /app
WORKDIR /app WORKDIR /app
# Copy the current directory contents into the container at /app
COPY . /app COPY . /app
# Install any needed packages specified in requirements.txt
RUN pip install --trusted-host pypi.python.org -r /app/requirements.txt RUN pip install --trusted-host pypi.python.org -r /app/requirements.txt
# Define environment variable
ENV TOKEN X
# Run app.py when the container launches
CMD ["python", "-u", "SlashBot.py"] CMD ["python", "-u", "SlashBot.py"]

View File

@ -13,12 +13,11 @@ escaping = ('\\ ', '\\ ')
markdownEscape = lambda s: s.replace("_", "\\_").replace("*", "\\*").replace("[", "\\[").replace("`", "\\`") markdownEscape = lambda s: s.replace("_", "\\_").replace("*", "\\*").replace("[", "\\[").replace("`", "\\`")
# Docker env # Docker env
if os.environ.get('TOKEN') and os.environ['TOKEN'] != 'X': Token = os.environ.get('TOKEN')
Token = os.environ['TOKEN'] if not Token:
else:
raise Exception('no token') raise Exception('no token')
if os.environ.get('PROXY') and os.environ['PROXY'] != 'X': if os.environ.get('PROXY'):
telegram_proxy = os.environ['PROXY'] telegram_proxy = os.environ['PROXY']
requests_proxies = {'all': os.environ['PROXY']} requests_proxies = {'all': os.environ['PROXY']}
else: else: