Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docker: add dockerfile #365

Open
xuhe2 opened this issue Oct 21, 2024 · 1 comment
Open

docker: add dockerfile #365

xuhe2 opened this issue Oct 21, 2024 · 1 comment

Comments

@xuhe2
Copy link

xuhe2 commented Oct 21, 2024

Dockerfile

FROM python:3.10-alpine 
COPY . /app
WORKDIR /app
RUN pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
ENTRYPOINT ["python3","main.py"]
  • 之前的dockerfile使用python3.9版本, 不支持的python语法格式会出现以下问题
Traceback (most recent call last):                                                                                                                                                          
  File "/app/main.py", line 5, in <module>
    from api.base import Chaoxing, Account
  File "/app/api/base.py", line 20, in <module>
    from api.answer import *
  File "/app/api/answer.py", line 37, in <module>
    class Tiku:
  File "/app/api/answer.py", line 86, in Tiku
    def config_set(self,config:configparser.ConfigParser|None):
TypeError: unsupported operand type(s) for |: 'ABCMeta' and 'NoneType'
  • 使用从python.10构建的docker image可以修复这个问题

Usage

docker run -it --rm chaoxing -u 131xxxx -p xxxxxxxx -l xxx,xxxx

Q

是否接受添加dockerfile的PR?

@Samueli924
Copy link
Owner

如果方便可以帮忙提交一下PR,感谢帮助。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants