-
Notifications
You must be signed in to change notification settings - Fork 284
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19 from chxcode/add-dockerfile
Add docker mode
- Loading branch information
Showing
3 changed files
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
FROM python:3.6.8 | ||
|
||
ENV PYTHONUNBUFFERED 1 | ||
|
||
# 更新pip | ||
RUN pip install --upgrade pip --index-url https://pypi.douban.com/simple | ||
|
||
# 工作目录 | ||
WORKDIR /code | ||
ADD . /code | ||
|
||
# pip安装依赖包 | ||
RUN pip install -r requirements.txt --index-url https://pypi.douban.com/simple | ||
|
||
# 打开容器的8000端口 | ||
EXPOSE 8000 | ||
|
||
# 执行命令行,启动django服务 | ||
CMD ["python", "manage.py", "runserver", "0.0.0.0:8000"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Django>=3.0.1 | ||
django-cors-headers>=3.5.0 | ||
enum34>=1.1.10 | ||
requests>=2.22.0 |