-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.earth
35 lines (30 loc) · 1.39 KB
/
build.earth
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
VERSION 0.8
bundle:
FROM docker.io/library/ruby:3.2
COPY --dir Gemfile Gemfile.lock /src/site
WORKDIR /src/site
RUN bundle install
checkout:
ARG CONTENT=gazebo
LOCALLY
RUN sh checkout_content.sh $CONTENT
content:
FROM +bundle
COPY --dir content/ layouts/ lib/ Rules README.md nanoc.yaml /src/site
compile:
FROM +content
RUN bundle exec nanoc compile
SAVE ARTIFACT output/ AS LOCAL output
server:
ARG CONTENT=gazebo
FROM docker.io/library/httpd:2.4
COPY +compile/output /usr/local/apache2/htdocs
# Enable mod_info to support dumping config on startup.
RUN sed -i 's/^#LoadModule info_module modules\/mod_info\.so/LoadModule info_module modules\/mod_info.so/' /usr/local/apache2/conf/httpd.conf
# Enable mod_rewrite to support rewriting slug urls to canonical.
RUN sed -i 's/^#LoadModule rewrite_module modules\/mod_rewrite\.so/LoadModule rewrite_module modules\/mod_rewrite.so/' /usr/local/apache2/conf/httpd.conf
# Enable mod_alias to support redirecting migrated questions to StackExchange.
RUN sed -i 's/^#LoadModule alias_module modules\/mod_alias\.so/LoadModule alias_module modules\/mod_alias.so/' /usr/local/apache2/conf/httpd.conf
# Include generated config file in the document root.
RUN sed -i '/^<Directory "\/usr\/local\/apache2\/htdocs">/a\ Include htdocs/httpd/directory.conf.inc' /usr/local/apache2/conf/httpd.conf
SAVE IMAGE ${CONTENT}-answers-httpd