mirror of
https://github.com/wezm/wezm.net.git
synced 2024-11-18 04:42:47 +00:00
Add Dockerfile
This commit is contained in:
parent
f0dfb1c0c4
commit
c48d6b6076
2 changed files with 43 additions and 3 deletions
38
Dockerfile
Normal file
38
Dockerfile
Normal 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
|
8
Gemfile
8
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
|
||||
|
|
Loading…
Reference in a new issue