-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile.stage
47 lines (35 loc) · 1.18 KB
/
Dockerfile.stage
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
FROM ruby:3.1.2-slim
RUN apt-get update && apt-get install -y curl
RUN curl -sL https://deb.nodesource.com/setup_18.x | bash - && apt-get install -y nodejs
RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list && \
curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \
apt-get update -qq && apt-get install -yq --no-install-recommends \
build-essential \
gnupg2 \
git \
yarn \
nano \
default-libmysqlclient-dev \
msmtp-mta \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
ENV LANG=C.UTF-8 \
BUNDLE_JOBS=4 \
BUNDLE_RETRY=3 \
RAILS_ENV=staging \
RAILS_SERVE_STATIC_FILES=true \
RAILS_RELATIVE_URL_ROOT='/' \
NODE_ENV=staging
WORKDIR /usr/src/app
COPY Gemfile /Gemfile
COPY Gemfile.lock /Gemfile.lock
COPY package.json yarn.lock /app/
RUN gem update --system && gem install bundler && bundle config set --local without test development && bundle install
RUN yarn
COPY . /usr/src/app
COPY .msmtprc /root/
COPY entrypoint.sh /usr/bin/
RUN chmod +x /usr/bin/entrypoint.sh
RUN yarn cache clean
ENTRYPOINT ["sh", "/usr/bin/entrypoint.sh"]
EXPOSE 3000
CMD ["bundle", "exec", "rails", "s", "-b", "0.0.0.0"]