-
Notifications
You must be signed in to change notification settings - Fork 33
/
Dockerfile-allinone
23 lines (22 loc) · 1.08 KB
/
Dockerfile-allinone
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
FROM node:18-alpine as front
ARG VERSION
WORKDIR /app
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories
RUN apk add --no-cache git
RUN corepack enable
#RUN git clone --depth=1 https://gitee.com/kingwrcy/mblog-front.git
RUN git clone --depth=1 https://github.com/kingwrcy/mblog-front.git
WORKDIR mblog-front
RUN yarn install --registry=https://registry.npm.taobao.org
RUN sed -i 's#REPLACE_VERSION_HERE#'"$VERSION"'#g' .env.all
RUN yarn build-only --mode=all
FROM openjdk:17-alpine
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories && apk update && apk add busybox-extras
RUN apk add tzdata && cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo "Asia/Shanghai" > /etc/timezone && apk del tzdata
ADD ./target/memo-0.0.1-SNAPSHOT.jar /app/memo-0.0.1-SNAPSHOT.jar
ADD ./target/classes/*.properties /app/
COPY --from=front /app/mblog-front/dist /app/static
ENV JAVA_OPTS="-Xms512m -Xmx512m"
ENV DB_TYPE=""
ENV MBLOG_EMBED=true
CMD java $JAVA_OPTS -jar /app/memo-0.0.1-SNAPSHOT.jar --spring.config.location=/app/application$DB_TYPE.properties