-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
94 additions
and
1 deletion.
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,5 @@ | ||
__pycache__/ | ||
*.pyc | ||
*.pyo | ||
.env | ||
.git/ |
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,26 @@ | ||
FROM ubuntu:jammy | ||
ARG DEBIAN_FRONTEND=noninteractive | ||
ENV TZ=Asia/Shanghai | ||
CMD ["/bin/bash"] | ||
|
||
RUN apt update && apt install ca-certificates -y | ||
COPY sources.list /etc/apt/sources.list | ||
# 安装必要的工具 | ||
RUN apt-get update && apt-get install -y \ | ||
wget \ | ||
sudo \ | ||
iptables \ | ||
ufw | ||
|
||
# 安装conda环境到/opt/miniconda | ||
RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda3_latest.sh && \ | ||
chmod +x miniconda3_latest.sh && \ | ||
./miniconda3_latest.sh -b -p /opt/miniconda && \ | ||
echo "export PATH=/opt/miniconda/bin:\$PATH" >> ~/.bashrc | ||
|
||
# 配置 Miniconda 的环境变量 | ||
ENV PATH="/opt/miniconda/bin:${PATH}" | ||
|
||
# 复制依赖文件并安装 Python 包 | ||
COPY requirements.txt /root/ | ||
RUN /opt/miniconda/bin/pip install -r /root/requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple |
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,12 @@ | ||
services: | ||
macropage: | ||
image: macropage:v1.1 | ||
container_name: macropage-app | ||
# network_mode: host # 不要使用host模式,会出现异常,更推荐使用bridge模式端口映射 | ||
volumes: | ||
- .:/opt/code # 设置代码挂载目录 | ||
restart: always | ||
ports: | ||
- "8501:8501" # 确保映射了端口 | ||
working_dir: /opt/code # 设置容器的工作目录 | ||
command: ["/opt/miniconda/bin/streamlit", "run", "main.py"] |
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,6 @@ | ||
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释 | ||
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy main restricted universe multiverse | ||
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-updates main restricted universe multiverse | ||
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-backports main restricted universe multiverse | ||
# 以下安全更新软件源包含了官方源与镜像站配置,如有需要可自行修改注释切换 | ||
deb http://security.ubuntu.com/ubuntu/ jammy-security main restricted universe multiverse |