Add Dockerfile

This commit is contained in:
Wesley Moore 2019-02-11 11:46:44 +11:00
parent f0dfb1c0c4
commit c48d6b6076
No known key found for this signature in database
GPG key ID: BF67766C0BC2D0EE
2 changed files with 43 additions and 3 deletions

38
Dockerfile Normal file
View file

@ -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

View file

@ -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