wangpengfei
2023-06-02 064c0874e5fd041c4641ef873d1bf72ac98a184d
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
40
41
42
43
44
45
46
47
48
49
# 第一阶段:构建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
 
# 启动OpenResty服务
#CMD ["/usr/local/openresty/bin/openresty", "-g", "daemon off;"]