Skip to content

Commit

Permalink
chore: 🤖 Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
ThaddeusJiang committed Jul 22, 2024
1 parent 5fbb05e commit b86617f
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,4 @@ dev.sh
start.sh
run.sh
nohup.out
.env
27 changes: 27 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# 使用官方的 Elixir 镜像作为基础镜像
FROM elixir:1.17.2

# 安装必要的依赖
RUN apt-get update && \
apt-get install -y \
build-essential \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

# 设置工作目录
WORKDIR /app

# 复制 mix.exs 和 mix.lock 文件并安装依赖
COPY mix.exs mix.lock ./
RUN mix do local.hex --force, local.rebar --force, deps.get

# 复制剩余的项目文件
COPY . .

# 设置环境变量(如果需要在运行时指定,可以在 docker run 命令中传递)
ENV TELEGRAM_BOT_TOKEN=$TELEGRAM_BOT_TOKEN
ENV AIER_API_TOKEN=$AIER_API_TOKEN
ENV OPENAI_API_KEY=$OPENAI_API_KEY

# 运行项目
CMD ["mix", "run", "--no-halt"]
4 changes: 0 additions & 4 deletions zbpack.json

This file was deleted.

0 comments on commit b86617f

Please sign in to comment.