-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile
executable file
·61 lines (48 loc) · 1.16 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# syntax=docker/dockerfile:1.3-labs
FROM ruby:3-alpine as base
LABEL maintainer="Mike Glenn <[email protected]>"
LABEL ilude-project=joyride
RUN \
mkdir -p /app /etc/hosts.d /etc/dnsmasq.d && \
touch /etc/hosts.d/hosts && \
touch /etc/dnsmasq.d/hosts && \
echo 'install: --no-document' >> /etc/gemrc && \
echo 'update: --no-document' >> /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/*
ENV APP /app
ENV GEM_HOME /gems
WORKDIR $APP
COPY --chmod=755 <<-"EOF" /usr/local/bin/docker-entrypoint.sh
#!/bin/sh
set -e
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