-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
48 lines (39 loc) · 1.35 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
FROM alpine:latest
MAINTAINER [email protected]
#RUN sed -i "s@http://dl-cdn.alpinelinux.org/@https://mirrors.huaweicloud.com/@g" /etc/apk/repositories
RUN apk update
RUN apk add --no-cache \
curl \
git \
openssh-client \
rsync \
build-base \
libc6-compat
ARG HUGO_VERSION
ARG IS_NO_TOOLS
RUN mkdir -p /usr/local/src && \
cd /usr/local/src && \
curl -L https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_Linux-64bit.tar.gz | tar -xz && \
mv hugo /usr/local/bin/hugo && \
addgroup -Sg 1000 hugo && \
adduser -Sg hugo -u 1000 -h /src hugo
ADD website /website
WORKDIR /website
RUN apk add nodejs npm bash
RUN curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --nightly
ENV PATH="/root/.yarn/bin:/root/.config/yarn/global/node_modules/.bin:$PATH"
RUN yarn install
#RUN git submodule update --init --recursive --depth 1
RUN git submodule update --init --recursive
#RUN git pull --force
RUN cp -a -R /website/. /src
WORKDIR /src
RUN /usr/local/bin/hugo version
EXPOSE 1313
RUN hugo --minify
#ENTRYPOINT ["/usr/local/bin/hugo", "server","--buildFuture", "--bind", "0.0.0.0"]
RUN curl -o /src/public/robots.txt https://www.xieyaokun.com/robots.txt
FROM nginx:alpine
MAINTAINER [email protected]
LABEL author=jingjingxyk
COPY --from=0 /src/public/ /usr/share/nginx/html