-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDockerfile
More file actions
38 lines (28 loc) · 1.26 KB
/
Dockerfile
File metadata and controls
38 lines (28 loc) · 1.26 KB
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
FROM ruby:2.6.5-alpine
ENV RAILS_ENV production
LABEL version="1.0.5"
# RUN apt-get update && apt-get install -y --no-install-recommends apt-utils
RUN apk add --no-cache --update build-base \
linux-headers \
git \
postgresql-dev \
nodejs \
tzdata\
yarn\
imagemagick
# RUN apt-get update -qq && DEBIAN_FRONTEND=noninteractive apt-get install -yq --no-install-recommends build-essential postgresql-client curl dirmngr apt-transport-https lsb-release ca-certificates nodejs yarn && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && truncate -s 0 /var/log/*log
RUN mkdir /application
WORKDIR /application
COPY Gemfile* /application/
COPY package.json /application/
COPY yarn.lock /application/
RUN gem install bundler -v 2.1.4 && \
bundle install --no-cache --without development test && \
rm -rf /usr/local/bundle/bundler/gems/*/.git \
/usr/local/bundle/cache/
RUN yarn install
COPY . /application
RUN RAILS_ENV=production rails assets:precompile && \
rm -rf node_modules tmp/* log/*
EXPOSE 3000
CMD ["rails", "server", "-b", "0.0.0.0"]