You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

43 lines
1.5 KiB

# 使用官方的Ubuntu镜像作为基础镜像
FROM ubuntu:20.04
# 定义时区参数
ENV TZ=Asia/Shanghai
# 设置时区
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo '$TZ' > /etc/timezone
# 使用清华大学的apt源
RUN sed -i 's/http:\/\/archive.ubuntu.com/http:\/\/mirrors.tuna.tsinghua.edu.cn\/ubuntu/g' /etc/apt/sources.list
# 更新软件源并安装必要的软件包
RUN apt-get update -y && \
apt-get install -y vim git curl wget expect zsh autojump jq python3-distutils nginx=1.18.0* && \
apt install net-tools -y && \
apt install iputils-ping -y && \
apt install mysql-client -y && \
apt install unzip -y && \
apt-get clean && \
mkdir -p /data/wwwroot/oss && \
rm -rf /var/lib/apt/lists/*
RUN echo "alias web='cd /data/wwwroot/oss/web'" >> /root/.bashrc
RUN echo "alias dev='cd /data/mmogrun/publish/bin'" >> /root/.bashrc
RUN echo "alias logs='cd /data/mmogrun/publish/log'" >> /root/.bashrc
RUN echo "alias cfg='cd /data/mmogrun/publish/cfg'" >> /root/.bashrc
RUN echo "alias ctrl='cd /data/mmogrun/publish/ctrl_sh'" >> /root/.bashrc
# 将当前目录下的配置文件复制到容器的 /etc/nginx/sites-available/ 目录下
COPY 3rd/nginx/default /etc/nginx/sites-available/default
# 安装oh-my-zsh
COPY 3rd/.oh-my-zsh /root/.oh-my-zsh/
COPY 3rd/.zshrc /root/.zshrc
RUN chsh -s "/bin/zsh" root
# 暴露默认的Nginx端口
EXPOSE 80
EXPOSE 56318
# 启动Nginx服务
CMD ["nginx", "-g", "daemon off;"]