File size: 578 Bytes
f373e34
 
 
dfb7d54
 
 
 
f373e34
4b8300f
 
 
f373e34
4b8300f
 
dfb7d54
4b8300f
 
f373e34
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
FROM denoland/deno:latest

WORKDIR /app

# 在复制文件之前就进行清理,确保一个非常干净的环境
RUN rm -rf /app/node_modules /app/node_modules/.deno /deno-dir

COPY . .
# 设置环境变量
ENV DENO_NO_UPDATE_CHECK=1
ENV DENO_NO_PROMPT=1

# 确保清理任何现有的 node_modules
RUN rm -rf node_modules .deno 2>/dev/null || true
# 再次清理,以防万一(虽然通常前面的清理已足够)
# 缓存依赖项
RUN deno cache --reload --quiet main.ts

EXPOSE 8000

CMD ["deno", "run", "--allow-net", "--allow-env", "--node-modules-dir", "main.ts"]