File size: 635 Bytes
072e993 189641b 072e993 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# 使用node基础镜像
FROM node
# 设置大陆时区
ENV TZ Asia/Shanghai
# 赋值
ARG HOST=${HOST}
ARG KEY=${KEY}
ARG COPYRIGHT=${COPYRIGHT}
# 设置工作目录
WORKDIR /app
# 将本地的所有文件复制到工作目录
COPY . .
# 赋予权限/归递
RUN chmod -R 777 /tmp
RUN chmod -R 777 /app
# 安装数据库
RUN apt update
RUN apt install -y redis
# 修改配置
RUN sed -i -e "s/Host: localhost/Host: $HOST/g" \
-e "s/Key: '114514'/Key: '$KEY'/g" \
-e "s/Copyright: 'Copyright'/Copyright: '$COPYRIGHT'/g" \
/app/config/GTest.yaml
# 安装依赖
RUN npm install
# 暴露端口
EXPOSE 7860
# 启动!
CMD node app |