-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathDockerfile_with_nginx
39 lines (30 loc) · 1.03 KB
/
Dockerfile_with_nginx
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
# 拉取基础镜像
FROM openjdk:8-jdk-alpine
# 维护人
# MAINTAINER 951645267@qq.com
LABEL org.opencontainers.image.authors="951645267@qq.com"
ENV SERVICE=lx-doc
USER root
EXPOSE 9222
EXPOSE 80
# 处理时区
RUN apk add tzdata \
&& cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
&& echo "Asia/Shanghai" > /etc/timezone \
&& apk del tzdata
# 安装 nginx
RUN apk add --no-cache nginx
# nginx 日志目录
RUN mkdir -p /var/log/nginx/ \
# web 静态资源存放目录,这个目录最好映射到宿主机
&& mkdir -p /usr/web/html/ \
&& mkdir -p /usr/nginx/config/ \
&& mkdir -p /usr/app/${SERVICE}/ \
&& mkdir -p /usr/logs/${SERVICE}/ \
&& mkdir -p /usr/attament/${SERVICE}/
ADD run_in_docker_with_nginx.sh /usr/app/${SERVICE}/
# 如果是在windows下进行 docker 构建的话,要去掉 \r\n 换行符的\r
RUN sed -i 's/\r$//' /usr/app/${SERVICE}/*.sh
COPY lx-core/target/lx-doc.jar /usr/app/${SERVICE}/
WORKDIR /usr/app/${SERVICE}/
ENTRYPOINT ["sh", "run_in_docker_with_nginx.sh", "initStart"]