-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathDockerfile
More file actions
55 lines (45 loc) · 1.52 KB
/
Copy pathDockerfile
File metadata and controls
55 lines (45 loc) · 1.52 KB
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
FROM public.ecr.aws/docker/library/ruby:3.1.3
ENV DEBIAN_FRONTEND=noninteractive
# Install prerequisites
RUN set -ex && \
echo "===> Installing dependencies" && \
apt-get -y update && \
apt-get install -y --force-yes --no-install-recommends \
curl wget tar gzip gnupg apt-transport-https ca-certificates tzdata locales && \
\
echo "===> Installing database libraries" && \
apt-get install -y --force-yes --no-install-recommends sqlite3 && \
\
echo "===> Installing dev tools" && \
mkdir -p /usr/share/man/man1 && \
apt-get install -y --force-yes --no-install-recommends \
sudo git openssh-client rsync vim \
net-tools netcat parallel unzip zip bzip2 && \
\
echo "===> Cleaning up" && \
rm -rf /var/lib/apt/lists/*;
# Set timezone to UTC by default
RUN ln -sf /usr/share/zoneinfo/Etc/UTC /etc/localtime
# Set language
RUN locale-gen en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
# Upgrade RubyGems and Bundler
RUN gem update --system 3.4.22
RUN gem install bundler -v '~> 2.4.22'
RUN mkdir -p "$GEM_HOME" && chmod -R 777 "$GEM_HOME"
ENV BUNDLE_SILENCE_ROOT_WARNING 1
# Setup directory
RUN mkdir /app
WORKDIR /app
# Add files
COPY lib_injection_rails_app /app
# Install gems
RUN set -eu; \
ruby_minor="$(ruby -e 'print RUBY_VERSION.split(".").take(2).join(".")')"; \
cp "gemfiles/ruby-${ruby_minor}.gemfile.lock" Gemfile.lock; \
bundle config set --local deployment 'true'; \
bundle install
# Set entrypoint
ENTRYPOINT ["/bin/bash", "-c"]
CMD ["bundle exec rails server -b 0.0.0.0 -p 18080"]