-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathDockerfile
More file actions
33 lines (24 loc) · 703 Bytes
/
Dockerfile
File metadata and controls
33 lines (24 loc) · 703 Bytes
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
FROM alpine:3.2
MAINTAINER Pan Jiabang <[email protected]>
COPY ./package.json /tmp/
WORKDIR /tmp/
# Install Nginx and Node.js env
RUN apk update && \
apk add nginx && \
apk add nodejs python make g++ && \
npm install hexo -g && \
npm install && \
apk del make g++ python && \
rm -rf /var/cache/apk/* && \
echo "Done"
# Copy blog source
COPY ./ /tmp
RUN hexo generate && \
cp -a /tmp/public/* /usr/share/nginx/html && \
#rm -rf ./* && \
ln -sf /dev/stdout /var/log/nginx/access.log && ln -sf /dev/stderr /var/log/nginx/error.log && \
echo "Done"
RUN npm un hexo -g && apk del nodejs
RUN rm -rf /tmp/*
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]