提交 357f0940 编写于 作者: J johnniang

Add Dockerfile support

上级 f3878657
FROM openjdk:8-jdk-alpine
LABEL maintainer="Ryan Wang<i@ryanc.cc>"
WORKDIR /opt/halo
ADD . /tmp
ENV TZ=Asia/Shanghai \
DB_USER="admin" \
DB_PASSWORD="123456"
VOLUME /tmp
RUN ln -snf /usr/share/zoneinfo/${TZ} /etc/localtime && echo ${TZ} > /etc/timezone
ARG JAR_FILE=build/libs/halo-1.0.0.bata.jar
ARG PORT=8090
RUN cd /tmp && ./gradlew bootjar && mv build/libs/* /opt/halo/ \
&& rm -rf /tmp/* && rm -rf ~/.gradle
ENV TZ=Asia/Shanghai
EXPOSE 8090
COPY ${JAR_FILE} halo.jar
ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-Dlogging.level.run.halo.app=INFO", "-jar","/opt/halo/halo-1.0.0.jar","--spring.datasource.username=${DB_USER}","--spring.datasource.password=${DB_PASSWORD}"]
EXPOSE ${PORT}
ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","halo.jar"]
\ No newline at end of file
......@@ -25,7 +25,7 @@ public class Application {
public static void main(String[] args) {
// Customize the spring config location
System.setProperty("spring.config.additional-location", "file:${user.home}/halo/,file:${user.home}/halo-dev/");
System.setProperty("spring.config.additional-location", "file:${user.home}/.halo/,file:${user.home}/halo-dev/");
// Run application
SpringApplication.run(Application.class, args);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册