From c48d6b6076a7f450fb867272912e5bc336b9caa8 Mon Sep 17 00:00:00 2001 From: Wesley Moore Date: Mon, 11 Feb 2019 11:46:44 +1100 Subject: [PATCH] Add Dockerfile --- Dockerfile | 38 ++++++++++++++++++++++++++++++++++++++ Gemfile | 8 +++++--- 2 files changed, 43 insertions(+), 3 deletions(-) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..7fa179d --- /dev/null +++ b/Dockerfile @@ -0,0 +1,38 @@ +FROM alpine:3.9 AS build + +ARG WEZMUID=2000 +ARG WEZMGID=2000 +ARG USER=wezm + +RUN apk --update add --no-cache ruby-dev ruby-bundler ruby-bigdecimal ruby-json build-base zlib-dev \ + && addgroup -g ${WEZMGID} ${USER} \ + && adduser -D -u ${WEZMUID} -G ${USER} -h /home/${USER} -D ${USER} + +RUN mkdir /usr/share/www && chown wezm:wezm /usr/share/www + +WORKDIR /usr/share/www + +USER wezm + +COPY --chown=wezm:wezm Gemfile . +COPY --chown=wezm:wezm Gemfile.lock . + +RUN bundle install -j 4 --deployment --without 'test development' + +COPY --chown=wezm:wezm . . + +RUN bundle exec nanoc co + + +FROM 791569612186.dkr.ecr.ap-southeast-2.amazonaws.com/nginx + +ARG WEZMUID=2000 +ARG WEZMGID=2000 +ARG USER=wezm + +RUN addgroup -g ${WEZMGID} ${USER} \ + && adduser -D -u ${WEZMUID} -G ${USER} -h /home/${USER} -D ${USER} + +COPY --from=build --chown=wezm:wezm /usr/share/www/output /usr/share/www + +EXPOSE 80 diff --git a/Gemfile b/Gemfile index 53ff668..5b4bf1c 100644 --- a/Gemfile +++ b/Gemfile @@ -15,10 +15,12 @@ gem 'builder' gem 'fssm' gem 'systemu' gem 'listen' -gem 'guard-nanoc' gem 'adsf' gem 'rouge' -if RbConfig::CONFIG['target_os'] =~ /(?i-mx:bsd|dragonfly)/ - gem 'rb-kqueue', '>= 0.2' +group :development do + gem 'guard-nanoc' + if RbConfig::CONFIG['target_os'] =~ /(?i-mx:bsd|dragonfly)/ + gem 'rb-kqueue', '>= 0.2' + end end