1
0
Fork 1
mirror of https://github.com/wezm/wezm.net.git synced 2024-12-24 21:19:53 +00:00
wezm.net/v1/Dockerfile

39 lines
882 B
Text
Raw Normal View History

2019-02-11 00:46:44 +00:00
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