forked from themarshallproject/klaxon
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile.server
48 lines (34 loc) · 1.2 KB
/
Dockerfile.server
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
FROM public.ecr.aws/docker/library/ruby:2.7.7
ARG USE_CRON=false
ENV USE_CRON=${USE_CRON}
# Update packages and install cron
RUN apt -y update && apt upgrade -yqq && apt install -y cron
# Create the log file to be able to store logs
RUN touch /var/log/cron.log
# Cron (at least in Debian) does not execute crontabs with more than 1 hardlink, see bug 647193.
# As Docker uses overlays, it results with more than one link to the file, so you have to touch
# it in your startup script, so the link is severed.
RUN touch /etc/crontab /etc/cron.*/*
# Throw errors if Gemfile has been modified since Gemfile.lock
RUN bundle config --global frozen 1
# Set up the app directory
WORKDIR /usr/src/app
# Configure bundler
ENV LANG=C.UTF-8 \
BUNDLE_JOBS=4 \
BUNDLE_RETRY=3
# Store Bundler settings in the project's root
ENV BUNDLE_APP_CONFIG=.bundle
# Install specific bundler version
RUN gem install bundler -v 2.4.22
# Copy over the dependency files
COPY Gemfile .
COPY Gemfile.lock .
# Install dependencies
RUN bundle install
# Copy over the rest of the app
COPY . .
RUN ["chmod", "+x", "./docker-entrypoint.sh"]
EXPOSE 3001
ENTRYPOINT ["./docker-entrypoint.sh"]
CMD ["bundle", "exec", "puma", "-C", "config/puma.rb"]