Skip to content

Commit

Permalink
fixes for sal
Browse files Browse the repository at this point in the history
  • Loading branch information
ilude committed May 5, 2023
1 parent 880d29f commit 1518c76
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 16 deletions.
22 changes: 7 additions & 15 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,32 +5,26 @@ LABEL maintainer="Mike Glenn <mglenn@ilude.com>"
LABEL ilude-project=joyride

RUN \
mkdir -p /app /usr/local/etc \
mkdir -p /app /etc \
&& { \
echo 'install: --no-document'; \
echo 'update: --no-document'; \
} >> /usr/local/etc/gemrc \
&& apk add --no-cache bash shadow tzdata \
} >> /etc/gemrc \
&& apk add --no-cache \
bash \
dnsmasq \
shadow \
tzdata \
&& rm -rf \
/usr/lib/ruby/gems/*/cache/* \
/root/.gem/ \
/var/cache/apk/* \
/tmp/* \
/var/tmp/*

ARG USER=anvil
ENV USER=${USER}
ARG PUID=1000
ARG PGID=1000
ENV APP /app
ENV GEM_HOME /gems

RUN \
groupadd -g $PGID $USER && \
useradd -s /sbin/nologin -g $PGID -u $PUID -d /home/$USER $USER && \
mkdir -p /home/anvil && \
chown $USER:$USER $APP

WORKDIR $APP

COPY --chmod=755 <<-"EOF" /usr/local/bin/docker-entrypoint.sh
Expand Down Expand Up @@ -65,5 +59,3 @@ FROM base AS production

COPY --from=builder ${GEM_HOME} ${GEM_HOME}
COPY ./app $APP

USER $USER
2 changes: 1 addition & 1 deletion app/template.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def initialize(output_path, template_path, log = Logger.new(stdout))
end

def write_template(template_context={})
erb = ERB.new(File.open(template_path).read, 0, "<>")
erb = ERB.new(File.open(template_path).read)
output = erb.result(TemplateContext.new(template_context).get_binding)
File.write(output_path, output)
rescue => ex
Expand Down

0 comments on commit 1518c76

Please sign in to comment.