Files
backend/Dockerfile

29 lines
571 B
Docker
Raw Permalink Normal View History

# 使用Debian bookworm-slim作为生产镜像
FROM debian:bookworm-slim
# 安装必要的运行时依赖
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
tzdata \
libsqlite3-0 \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get clean
# 设置工作目录
WORKDIR /app
# 从宿主机复制编译好的二进制文件
COPY server ./carrot_bbs
# 复制配置文件
COPY configs ./configs
# 给可执行文件添加执行权限
RUN chmod +x ./carrot_bbs
# 暴露端口
EXPOSE 8080
# 默认命令
CMD ["./carrot_bbs"]