-
Notifications
You must be signed in to change notification settings - Fork 11
/
Dockerfile
58 lines (46 loc) · 1.49 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
FROM ruby:3.0-slim
MAINTAINER Meedan <[email protected]>
# the Rails stage can be overridden from the caller
ENV RAILS_ENV development
# https://www.mikeperham.com/2018/04/25/taming-rails-memory-bloat/
ENV MALLOC_ARENA_MAX 2
# Set a UTF-8 capabable locale
ENV LC_ALL C.UTF-8
ENV LANG C.UTF-8
ENV LANGUAGE C.UTF-8
# Setup a user account
ENV DEPLOYUSER=checkdeploy
RUN useradd ${DEPLOYUSER} -s /bin/bash -m
RUN apt-get update -qq && apt-get install -y --no-install-recommends curl
RUN apt-get update && apt-get install --no-install-recommends -y \
build-essential \
ffmpegthumbnailer \
ffmpeg \
git \
graphicsmagick \
libidn11-dev \
inotify-tools \
libpq-dev \
libtag1-dev \
lsof
# CMD and helper scripts
COPY --chown=root:root production/bin /opt/bin
# tx client
RUN curl -o- https://raw.githubusercontent.com/transifex/cli/master/install.sh | bash
# install our app
WORKDIR /app
COPY Gemfile /app/Gemfile
COPY Gemfile.lock /app/Gemfile.lock
RUN echo "gem: --no-rdoc --no-ri" > ~/.gemrc && gem install bundler
RUN bundle config force_ruby_platform true
RUN bundle install --jobs 20 --retry 5
COPY . /app
# remember the Rails console history
RUN echo 'require "irb/ext/save-history"' > ~/.irbrc && \
echo 'IRB.conf[:SAVE_HISTORY] = 200' >> ~/.irbrc && \
echo 'IRB.conf[:HISTORY_FILE] = ENV["HOME"] + "/.irb-history"' >> ~/.irbrc
# startup
RUN chmod +x /app/docker-entrypoint.sh
RUN chmod +x /app/docker-background.sh
EXPOSE 3000
CMD ["/app/docker-entrypoint.sh"]