-
Notifications
You must be signed in to change notification settings - Fork 19
/
Dockerfile_whole
52 lines (42 loc) · 1.35 KB
/
Dockerfile_whole
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
50
51
52
# 拉取基础镜像
FROM openjdk:8-jdk-alpine
# 维护人
MAINTAINER 951645267@qq.com
ENV SERVICE lx-doc
ENV MYSQL_DATABASE=lx_doc
ENV MYSQL_ROOT_PASSWORD=lx_doc_test
USER root
EXPOSE 9222
EXPOSE 80
EXPOSE 3306
# 处理时区
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/config/${SERVICE}/ \
&& mkdir -p /usr/app/${SERVICE}/ \
&& mkdir -p /usr/logs/${SERVICE}/ \
&& mkdir -p /usr/attament/${SERVICE}/
# 安装 mysql
RUN apk add --update mysql mysql-client \
&& rm -f /var/cache/apk/*
COPY lx-doc.zip /usr/web/html/
RUN unzip -q -d /usr/web/html/ /usr/web/html/lx-doc.zip \
&& rm -rf /usr/web/html/lx-doc.zip
COPY nginx.conf /usr/nginx/config/
COPY my.cnf /etc/mysql/my.cnf
COPY mysql_init_start.sh /usr/app/${SERVICE}/
COPY doc.sql /usr/app/${SERVICE}/
COPY run_in_docker_whole.sh /usr/app/${SERVICE}/
COPY application-prod.yml /usr/config/${SERVICE}/
COPY lx-core/target/lx-doc.jar /usr/app/${SERVICE}/
WORKDIR /usr/app/${SERVICE}/
ENTRYPOINT ["sh", "run_in_docker_whole.sh", "initStart"]