FROM denoland/deno:latest | |
WORKDIR /app | |
# 在复制文件之前就进行清理,确保一个非常干净的环境 | |
RUN rm -rf /app/node_modules /app/node_modules/.deno /deno-dir | |
COPY . . | |
# 再次清理,以防万一(虽然通常前面的清理已足够) | |
RUN rm -rf node_modules /app/node_modules/.deno | |
RUN deno cache --node-modules-dir main.ts | |
EXPOSE 8000 | |
CMD ["deno", "run", "--allow-net", "--allow-env", "--node-modules-dir", "main.ts"] |