mirror of https://github.com/halo-dev/halo
Add Dockerfile support
parent
f38786573e
commit
357f094057
19
Dockerfile
19
Dockerfile
|
@ -1,17 +1,14 @@
|
||||||
FROM openjdk:8-jdk-alpine
|
FROM openjdk:8-jdk-alpine
|
||||||
LABEL maintainer="Ryan Wang<i@ryanc.cc>"
|
|
||||||
|
|
||||||
WORKDIR /opt/halo
|
VOLUME /tmp
|
||||||
ADD . /tmp
|
|
||||||
ENV TZ=Asia/Shanghai \
|
|
||||||
DB_USER="admin" \
|
|
||||||
DB_PASSWORD="123456"
|
|
||||||
|
|
||||||
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/ \
|
ENV TZ=Asia/Shanghai
|
||||||
&& rm -rf /tmp/* && rm -rf ~/.gradle
|
|
||||||
|
|
||||||
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"]
|
|
@ -25,7 +25,7 @@ public class Application {
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
// Customize the spring config location
|
// 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
|
// Run application
|
||||||
SpringApplication.run(Application.class, args);
|
SpringApplication.run(Application.class, args);
|
||||||
|
|
Loading…
Reference in New Issue