-
-
Notifications
You must be signed in to change notification settings - Fork 33
/
Dockerfile
38 lines (30 loc) · 1.25 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
FROM ruby:3.1.4-slim-bullseye
RUN apt-get update -yqq && \
apt-get install -yqq \
autoconf bison build-essential libssl-dev libyaml-dev libreadline6-dev \
zlib1g-dev libncurses5-dev libffi-dev libgdbm-dev git libgdbm6 libreadline-dev \
nginx nodejs dirmngr gnupg apt-transport-https ca-certificates npm imagemagick \
postgresql postgresql-contrib libpq-dev cron && \
npm install --global yarn && \
gem update --system && \
gem update strscan --default && \
gem install bundler -v 2.4.12 --no-document
ADD Gemfile Gemfile.lock Rakefile config.ru .ruby-version ./
# Setting MALLOC_ARENA_MAX to 2 can greatly reduce memory usage
ENV MALLOC_ARENA_MAX='2'
ENV HAVEN_DEPLOY="local"
ENV RAILS_ENV=production
ENV RAILS_SERVE_STATIC_FILES=true
RUN bundle config build.bcrypt --use-system-libraries && \
bundle config set --local deployment 'true' && \
bundle config set --local without 'development test'
RUN bundle install
# Cron to automatically update feeds
COPY deploymentscripts/lib/docker/feed-fetch-cron /etc/cron.d/feed-fetch-cron
RUN chmod 0644 /etc/cron.d/feed-fetch-cron
RUN crontab /etc/cron.d/feed-fetch-cron
RUN touch /var/log/cron.log
ADD . .
RUN bin/rails assets:precompile
EXPOSE 3000
CMD ["bash", "./bin/docker-start"]