🐳 设置时区.
This commit is contained in:
@@ -1,9 +1,17 @@
|
|||||||
FROM mysql:8.0.28
|
FROM mysql:8.0.28
|
||||||
|
# 系统时区
|
||||||
|
ARG TZ=Asia/Shanghai
|
||||||
|
# 设置时区
|
||||||
|
RUN ln -sf /usr/share/zoneinfo/${TZ} /etc/localtime && \
|
||||||
|
echo '${TZ}' > /etc/timezone
|
||||||
|
# 复制配置
|
||||||
|
COPY ./my.cnf /etc/mysql/conf.d/my.cnf
|
||||||
|
# 复制初始化脚本
|
||||||
COPY ./sql/init-1-schema-databases.sql /tmp
|
COPY ./sql/init-1-schema-databases.sql /tmp
|
||||||
COPY ./sql/init-2-schema-tables.sql /tmp
|
COPY ./sql/init-2-schema-tables.sql /tmp
|
||||||
COPY ./sql/init-3-schema-quartz.sql /tmp
|
COPY ./sql/init-3-schema-quartz.sql /tmp
|
||||||
COPY ./sql/init-4-data.sql /tmp
|
COPY ./sql/init-4-data.sql /tmp
|
||||||
COPY ./my.cnf /etc/mysql/conf.d/my.cnf
|
# 设置初始化脚本
|
||||||
RUN cat /tmp/init-1-schema-databases.sql >> /tmp/init.sql && \
|
RUN cat /tmp/init-1-schema-databases.sql >> /tmp/init.sql && \
|
||||||
cat /tmp/init-2-schema-tables.sql >> /tmp/init.sql && \
|
cat /tmp/init-2-schema-tables.sql >> /tmp/init.sql && \
|
||||||
cat /tmp/init-3-schema-quartz.sql >> /tmp/init.sql && \
|
cat /tmp/init-3-schema-quartz.sql >> /tmp/init.sql && \
|
||||||
|
|||||||
@@ -1,4 +1,17 @@
|
|||||||
FROM redis:6.0.16-alpine
|
FROM redis:6.0.16-alpine
|
||||||
WORKDIR /data
|
WORKDIR /data
|
||||||
|
# 系统时区
|
||||||
|
ARG TZ=Asia/Shanghai
|
||||||
|
# 切换源
|
||||||
|
RUN \
|
||||||
|
echo "" > /etc/apk/repositories && \
|
||||||
|
echo "http://mirrors.aliyun.com/alpine/v3.8/main" >> /etc/apk/repositories && \
|
||||||
|
echo "http://mirrors.aliyun.com/alpine/v3.8/community" >> /etc/apk/repositories && \
|
||||||
|
apk update
|
||||||
|
# 设置时区
|
||||||
|
RUN apk add tzdata && \
|
||||||
|
ln -sf /usr/share/zoneinfo/${TZ} /etc/localtime && \
|
||||||
|
echo '${TZ}' > /etc/timezone
|
||||||
|
# redis 配置
|
||||||
COPY ./redis.conf /tmp
|
COPY ./redis.conf /tmp
|
||||||
RUN cat /tmp/redis.conf > /usr/local/redis.conf
|
RUN cat /tmp/redis.conf > /usr/local/redis.conf
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
FROM nginx:alpine
|
FROM nginx:alpine
|
||||||
USER root
|
USER root
|
||||||
# 时区
|
WORKDIR /app
|
||||||
|
# 系统时区
|
||||||
ARG TZ=Asia/Shanghai
|
ARG TZ=Asia/Shanghai
|
||||||
# 切换源
|
# 切换源
|
||||||
RUN \
|
RUN \
|
||||||
@@ -12,11 +13,14 @@ RUN \
|
|||||||
RUN apk add tzdata && \
|
RUN apk add tzdata && \
|
||||||
ln -sf /usr/share/zoneinfo/${TZ} /etc/localtime && \
|
ln -sf /usr/share/zoneinfo/${TZ} /etc/localtime && \
|
||||||
echo '${TZ}' > /etc/timezone
|
echo '${TZ}' > /etc/timezone
|
||||||
|
# 添加 jdk
|
||||||
RUN apk add openjdk8
|
RUN apk add openjdk8
|
||||||
|
# 删除原 nginx 配置
|
||||||
RUN rm -rf /etc/nginx/conf.d/*
|
RUN rm -rf /etc/nginx/conf.d/*
|
||||||
WORKDIR /app
|
# 复制包
|
||||||
COPY ./orion-visor-launch.jar /app/app.jar
|
COPY ./orion-visor-launch.jar /app/app.jar
|
||||||
COPY ./dist /usr/share/nginx/html
|
COPY ./dist /usr/share/nginx/html
|
||||||
COPY ./entrypoint.sh /app/entrypoint.sh
|
COPY ./entrypoint.sh /app/entrypoint.sh
|
||||||
COPY ./nginx.conf /etc/nginx/conf.d
|
COPY ./nginx.conf /etc/nginx/conf.d
|
||||||
|
# 启动
|
||||||
ENTRYPOINT [ "sh", "/app/entrypoint.sh" ]
|
ENTRYPOINT [ "sh", "/app/entrypoint.sh" ]
|
||||||
|
|||||||
Reference in New Issue
Block a user