forked from zendesk/samson
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
52 lines (42 loc) · 1 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
FROM ruby:3.2.5-slim
# Install dependencies
RUN \
apt-get update && \
apt-get install -y --no-install-recommends \
build-essential \
default-libmysqlclient-dev \
libpq-dev \
libsqlite3-dev \
wget \
apt-transport-https \
git \
openssh-client \
curl \
gnupg2 \
nodejs \
npm && \
rm -rf /var/lib/apt/lists/*
RUN curl -fsSL https://get.docker.com | bash -
WORKDIR /app
# Mostly static
COPY .ruby-version config.ru Rakefile .env.virtualbox ./
COPY bin bin
COPY public public
COPY db db
COPY .env.bootstrap .env
# NPM
COPY package.json ./
RUN npm install --silent >/dev/null
# Gems
COPY Gemfile Gemfile.lock ./
COPY plugins plugins
RUN bundle install --quiet --jobs 4
# Code
COPY config config
COPY app app
COPY lib lib
# Assets
COPY vendor/assets vendor/assets
RUN echo "takes 5 minute" && ./bin/decode_dot_env .env && RAILS_ENV=production PRECOMPILE=1 bundle exec rake assets:precompile 2>/dev/null
EXPOSE 9080
CMD ["bundle", "exec", "puma", "-C", "config/puma.rb"]