# 第一阶段:构建Go应用程序
|
#FROM golang as builder
|
#FROM golang:latest
|
# 第二阶段:构建OpenResty
|
FROM golang:latest
|
MAINTAINER cheliequan
|
|
RUN sed -i "s/deb.debian.org/mirrors.aliyun.com/g" /etc/apt/sources.list
|
RUN sed -i "s/security.debian.org/mirrors.aliyun.com\/debian-security/g" /etc/apt/sources.list
|
RUN sed -i "s@/archive.ubuntu.com/@/mirrors.aliyun.com/@g" /etc/apt/sources.list
|
RUN apt-get clean
|
RUN apt-get update
|
RUN apt-get install -y \
|
bash \
|
coreutils \
|
grep \
|
procps \
|
net-tools \
|
curl
|
|
|
# 切换工作目录
|
WORKDIR /data/apsServer
|
|
# 拷贝应用程序代码到容器中
|
COPY apsServer ./
|
#COPY apsServer /data/apsServer/
|
|
#COPY web /data/web/
|
|
|
# 设置start.sh为ENTRYPOINT
|
#ENTRYPOINT ["/data/apsServer/start.sh"]
|
|
# 执行启动脚本
|
CMD ["./apsServer"]
|
|
# 拷贝配置文件到容器中
|
#COPY nginx.conf /usr/local/openresty/nginx/conf/
|
#COPY openresty/nginx/conf/conf.d/* /usr/local/openresty/nginx/conf/conf.d/
|
|
# 拷贝Lua库到容器中
|
#COPY openresty/lualib/resty/*.lua /usr/local/openresty/lualib/resty/
|
|
# 容器向外提供服务的暴露端口
|
EXPOSE 9081
|
EXPOSE 9091
|
|
# 启动OpenResty服务
|
#CMD ["/usr/local/openresty/bin/openresty", "-g", "daemon off;"]
|