Create Dockerfile
Browse files- Dockerfile +33 -0
Dockerfile
ADDED
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#FROM python:3.10.0-alpine
|
2 |
+
# 使用官方的Python运行时作为父镜像
|
3 |
+
FROM python:3.10-slim-bullseye
|
4 |
+
|
5 |
+
ENV PIP_INDEX_URL=https://pypi.tuna.tsinghua.edu.cn/simple
|
6 |
+
RUN pip install --upgrade pip
|
7 |
+
RUN pip install mkdocs-material==9.5.5 mkdocs-glightbox
|
8 |
+
|
9 |
+
WORKDIR /hello-algo
|
10 |
+
# 安装git和其他系统依赖
|
11 |
+
RUN apt-get update && apt-get install -y git
|
12 |
+
# 克隆GitHub仓库
|
13 |
+
RUN git clone https://github.com/krahets/hello-algo /kralgo
|
14 |
+
|
15 |
+
RUN ls /kralgo -al
|
16 |
+
|
17 |
+
COPY /kralgo/hello-algo/overrides ./build/overrides
|
18 |
+
|
19 |
+
COPY /kralgo/hello-algo/docs ./build/docs
|
20 |
+
COPY /kralgo/hello-algo/mkdocs.yml mkdocs.yml
|
21 |
+
RUN mkdocs build -f mkdocs.yml
|
22 |
+
|
23 |
+
COPY /kralgo/hello-algo/zh-hant/docs ./build/zh-hant/docs
|
24 |
+
COPY /kralgo/hello-algo/zh-hant/mkdocs.yml ./zh-hant/mkdocs.yml
|
25 |
+
RUN mkdocs build -f ./zh-hant/mkdocs.yml
|
26 |
+
|
27 |
+
COPY /kralgo/hello-algo/en/docs ./build/en/docs
|
28 |
+
COPY /kralgo/hello-algo/en/mkdocs.yml ./en/mkdocs.yml
|
29 |
+
RUN mkdocs build -f ./en/mkdocs.yml
|
30 |
+
|
31 |
+
WORKDIR /hello-algo/site
|
32 |
+
EXPOSE 7860
|
33 |
+
CMD ["python", "-m", "http.server", "7860"]
|