forked from TeamNewPipe/website
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
65 lines (52 loc) · 1.54 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
FROM jekyll/jekyll as builder
COPY Gemfile /srv/jekyll
RUN bundle install
COPY Gemfile.lock /srv/jekyll
RUN bash -xc "chown jekyll: Gemfile.lock && \
cd /srv/jekyll && \
gem install bundler && \
bundle update"
WORKDIR /srv/jekyll
# define args and env vars before copying content to speed up subsequent builds, as they hardly ever change
ARG ISSO_ADDRESS
ENV JEKYLL_ENV=production
# copy static resources
COPY bootstrap bootstrap
COPY css css
COPY js js
COPY font-awesome font-awesome
COPY legal legal
COPY lunrjs lunrjs
COPY press press
COPY _plugins _plugins
COPY _layouts _layouts
COPY _includes _includes
COPY pdf pdf
COPY _config.yml .
COPY index.html .
COPY favicon.ico .
COPY blog blog
COPY donate donate
# copy files which are changed more regularly (aka content)
COPY .git .git
COPY _tutorials _tutorials
COPY _faq _faq
COPY FAQ FAQ
COPY img img
COPY _data _data
COPY _posts _posts
RUN bash -xc "chown -R jekyll: /srv/jekyll && \
bundle update jekyll && \
cd /srv/jekyll && \
jekyll clean && \
jekyll build && \
mv _site/ /data"
RUN ls -al /data /data/img
FROM nginx:alpine
# Disable access logs (if needed, can be fetched from the reverse proxy)
# and also make sure hidden files are not served by NGINX
# TODO the latter doesn't work currently
RUN sed -i 's/access_log.*/access_log off;/' /etc/nginx/nginx.conf && \
sed -i 's/^}/ application\/rss+xml rss;\n application\/atom+xml;\n}/' /etc/nginx/mime.types
COPY docker/nginx/conf.d/default.conf /etc/nginx/conf.d/
COPY --from=builder /data /usr/share/nginx/html