commit
60b6383382
3 changed files with 42 additions and 1 deletions
32
Dockerfile
Normal file
32
Dockerfile
Normal file
|
@ -0,0 +1,32 @@
|
|||
# ------- Build -------
|
||||
FROM ruby:2.7.1-alpine3.11 AS build
|
||||
|
||||
RUN apk add build-base
|
||||
|
||||
RUN mkdir -p /app
|
||||
WORKDIR /app
|
||||
|
||||
COPY Gemfile .
|
||||
COPY Gemfile.lock .
|
||||
RUN bundle config set deployment 'true'
|
||||
RUN bundle config set without 'development'
|
||||
RUN bundle install
|
||||
|
||||
COPY content content/
|
||||
COPY layouts layouts/
|
||||
COPY lib lib/
|
||||
COPY Guardfile .
|
||||
COPY Rules .
|
||||
COPY nanoc.yaml .
|
||||
|
||||
RUN bundle exec nanoc
|
||||
|
||||
|
||||
|
||||
# ------- Release -------
|
||||
FROM nginx:latest AS release
|
||||
|
||||
RUN rm -rf /usr/share/nginx/html/*
|
||||
COPY --from=build /app/output /usr/share/nginx/html
|
||||
|
||||
ENTRYPOINT ["nginx", "-g", "daemon off;"]
|
5
Gemfile
5
Gemfile
|
@ -3,7 +3,6 @@ source 'https://rubygems.org'
|
|||
|
||||
gem 'adsf'
|
||||
gem 'autoprefixer-rails'
|
||||
gem 'byebug'
|
||||
gem 'htmlcompressor'
|
||||
gem 'kramdown'
|
||||
gem 'mini_racer'
|
||||
|
@ -16,3 +15,7 @@ group :nanoc do
|
|||
gem 'guard-nanoc'
|
||||
gem 'guard-livereload'
|
||||
end
|
||||
|
||||
group :development do
|
||||
gem 'byebug'
|
||||
end
|
||||
|
|
|
@ -6,3 +6,9 @@ Durf Doen 2.0
|
|||
1. Install bundler (`gem install bundler`)
|
||||
2. Install other gems (`bundle install`)
|
||||
3. Build and serve the site (`bundle exec nanoc live`)
|
||||
|
||||
### Optional setup via docker
|
||||
|
||||
You can run the code in a separated docker environment. It compiles the code and serves the files via nginx.
|
||||
|
||||
docker build --tag durfdoen2 . && docker run --publish 8080:80 --detach --name dd durfdoen2
|
||||
|
|
Loading…
Reference in a new issue