diff --git a/alpine-mysql/Dockerfile b/alpine-mysql/Dockerfile index 0da054c..3840501 100644 --- a/alpine-mysql/Dockerfile +++ b/alpine-mysql/Dockerfile @@ -1,14 +1,18 @@ FROM alpine:latest LABEL maintainer="ehlxr.me@gmail.com" +ENV TZ "Asia/Shanghai" + WORKDIR /app VOLUME /data -RUN apk add --update --no-cache mysql mysql-client \ - && rm -f /var/cache/apk/* +RUN apk add --update --no-cache mysql mysql-client tzdata \ + && ln -sf /usr/share/zoneinfo/${TZ} /etc/localtime \ + && echo ${TZ} > /etc/timezone \ + && rm -rf /var/cache/apk/* COPY my.cnf /etc/mysql/my.cnf COPY startup.sh /startup.sh EXPOSE 3306 -CMD ["/startup.sh"] +CMD ["/startup.sh"] \ No newline at end of file diff --git a/blog/Dockerfile b/blog/Dockerfile index 8c094b2..ad5ea90 100644 --- a/blog/Dockerfile +++ b/blog/Dockerfile @@ -9,6 +9,12 @@ RUN hexo generate && gulp FROM nginx:alpine LABEL maintainer="ehlxr.me@gmail.com" +ENV TZ "Asia/Shanghai" WORKDIR /usr/share/nginx/html COPY --from=0 /hexo/public . +RUN apk upgrade --update \ + && apk add tzdata \ + && ln -sf /usr/share/zoneinfo/${TZ} /etc/localtime \ + && echo ${TZ} > /etc/timezone \ + && rm -rf /var/cache/apk/* ENTRYPOINT ["nginx", "-g", "daemon off;"] \ No newline at end of file