ol / Dockerfile
99i's picture
Create Dockerfile
0c1e1bf verified
raw
history blame
1.27 kB
# Builder stage
FROM ubuntu:latest
# 安装必要的依赖和 Caddy
RUN apt-get update && apt-get install -y wget curl ca-certificates openssl
RUN apt-get install -y tmux
# Install application
RUN curl https://ollama.ai/install.sh | sh
# Create the directory and give appropriate permissions
RUN mkdir -p /.ollama && chmod 777 /.ollama
WORKDIR /.ollama
# 安装必要的依赖
RUN apt-get update && \
apt-get install -y \
debian-keyring \
debian-archive-keyring \
apt-transport-https \
curl
# 添加 Caddy 的 GPG 密钥
RUN curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg
# 添加 Caddy 的 APT 源
RUN curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | tee /etc/apt/sources.list.d/caddy-stable.list
# 更新 APT 包列表并安装 Caddy
RUN apt-get update && \
apt-get install -y caddy
# Create the directory and give appropriate permissions
RUN mkdir -p /.ollama && chmod 777 /.ollama
# 复制 Caddyfile 配置到容器中
COPY Caddyfile /etc/caddy/Caddyfile
# 暴露 Caddy 和 Ollama 端口
EXPOSE 3000
# 启动 Caddy 和 Ollama 的主命令
CMD ["sh", "-c", "ollama serve & caddy run --config /etc/caddy/Caddyfile"]