apis-dev / Dockerfile
geqintan's picture
update
a3b1dd5
# 目前已经实现静态的gemini代理,下面需要使用lua实现动态替换 备份时间为 2025-02-26 00:03
# 基于OpenResty基础镜像
FROM openresty/openresty:1.21.4.1-0-jammy
# 安装必要的包(可选)
RUN apt-get update && apt-get install -y \
curl \
vim \
&& rm -rf /var/lib/apt/lists/*
# 创建用户
RUN useradd -m -s /bin/bash myuser
# 创建目录
RUN mkdir -p /data/myapp
# RUN mkdir -p /usr/local/openresty/nginx/client_body_temp
RUN mkdir -p /usr/local/openresty/nginx
# 修改目录的所有者和权限
RUN chown -R myuser:myuser /data/myapp
RUN chmod -R 755 /data/myapp
RUN chown -R myuser:myuser /usr/local/openresty/nginx
RUN chmod -R 755 /usr/local/openresty/nginx
# 设置工作目录
WORKDIR /data/myapp
# 切换到新用户
USER myuser
# 复制Lua脚本和nginx配置文件到容器中
COPY app.lua /data/myapp/
# COPY app_v1.lua /data/myapp/
# COPY get_will_trim_path.lua /usr/local/openresty/nginx/
# COPY app /data/myapp/app
COPY nginx.conf /usr/local/openresty/nginx/conf/nginx.conf
# 指定容器启动时运行的命令
CMD ["openresty", "-g", "daemon off;"]