forked from heycarsten/lcbo-api
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile.app.prod
56 lines (41 loc) · 1.2 KB
/
Dockerfile.app.prod
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
FROM ruby:2.5-stretch
# ENV POSTGRES_VERSION=12
ENV NODE_DIST=10.x
ENV PATH=/lcboapi/bin:$PATH
ENV HOME=/lcboapi
ENV RAILS_ENV=production
ENV RACK_ENV=production
# Install basics
RUN DEBIAN_FRONTEND=noninteractive \
apt-get -yqq update && \
apt-get -yqq install \
software-properties-common \
apt-transport-https \
build-essential \
git-core \
openssl \
libssl-dev \
acl \
zip \
pv \
postgresql-client \
libpq-dev
# Install latest stable version of node.js
RUN curl -sL https://deb.nodesource.com/setup_lts.x | bash -
RUN apt-get install -y nodejs
# Install Yarn.
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
RUN apt-get update && apt-get install -y yarn
RUN gem install bundler
RUN mkdir -p $HOME
WORKDIR $HOME
COPY Gemfile Gemfile
COPY Gemfile.lock Gemfile.lock
RUN bundle install --jobs 20 --retry 5 --without development test
COPY . .
RUN mkdir -p $HOME/log
RUN touch $HOME/log/production.log
RUN ASSETS_PRECOMPILE=1 bundle exec rake assets:precompile
EXPOSE 3000
CMD ["bundle", "exec", "puma", "-C", "config/puma.rb", "-p", "3000"]