-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
47 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.vscode/ | ||
*.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
FROM ruby:3.0.2-alpine3.14 | ||
# syntax=docker/dockerfile:1.3-labs | ||
FROM ruby:3-alpine as base | ||
|
||
LABEL maintainer="Mike Glenn <[email protected]>" | ||
LABEL ilude-project=joyride | ||
|
@@ -9,32 +10,60 @@ RUN \ | |
echo 'install: --no-document'; \ | ||
echo 'update: --no-document'; \ | ||
} >> /usr/local/etc/gemrc \ | ||
&& apk add --no-cache \ | ||
bash \ | ||
dnsmasq \ | ||
tzdata \ | ||
htop \ | ||
&& update-ca-certificates \ | ||
&& ln -snf /etc/localtime /usr/share/zoneinfo/$TZ && echo $TZ > /etc/timezone \ | ||
&& apk add --no-cache bash shadow tzdata \ | ||
&& rm -rf \ | ||
/usr/lib/ruby/gems/*/cache/* \ | ||
/root/.gem/ \ | ||
/var/cache/apk/* \ | ||
/tmp/* \ | ||
/var/tmp/* | ||
|
||
WORKDIR /app | ||
ARG USER=anvil | ||
ENV USER=${USER} | ||
ARG PUID=1000 | ||
ARG PGID=1000 | ||
ENV APP /app | ||
ENV GEM_HOME /gems | ||
|
||
COPY ./app/Gemfile /app/Gemfile | ||
RUN bundle install | ||
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 *-entrypoint.sh /usr/local/bin/ | ||
RUN chmod +x /usr/local/bin/*-entrypoint.sh | ||
COPY --chmod=755 <<-"EOF" /usr/local/bin/docker-entrypoint.sh | ||
#!/bin/sh | ||
set -e | ||
|
||
COPY ./app /app | ||
exec $@ | ||
EOF | ||
|
||
EXPOSE 54/udp | ||
|
||
ENTRYPOINT ["docker-entrypoint.sh"] | ||
CMD [ "bundle", "exec", "ruby", "joyride.rb" ] | ||
|
||
|
||
############################## | ||
# Begin builder | ||
############################## | ||
FROM base AS builder | ||
|
||
RUN apk --no-cache add \ | ||
build-base \ | ||
git | ||
|
||
COPY ./app/Gemfile $APP | ||
#COPY ./app/Gemfile.lock $APP | ||
RUN bundle install | ||
|
||
############################## | ||
# Begin production | ||
############################## | ||
FROM base AS production | ||
|
||
COPY --from=builder ${GEM_HOME} ${GEM_HOME} | ||
COPY ./app $APP | ||
|
||
USER $USER |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.