-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathDockerfile
44 lines (31 loc) · 1.01 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
## base stage
FROM ubuntu:18.04 AS base
ENV LANG=en_US.UTF-8
ENV LANGUAGE=en_US.UTF-8
ENV LC_ALL=C.UTF-8
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
imagemagick \
libpq-dev \
nodejs \
postgresql-client \
ruby \
ruby-dev \
zlib1g-dev
RUN apt-get update && apt-get install -y --no-install-recommends curl gnupg && \
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \
echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list && \
apt-get update && apt-get install -y --no-install-recommends yarn && \
apt-get autoremove -y curl gnupg
RUN gem install bundler -v 2.0.2
WORKDIR /campo
## production stage
FROM base AS production
ENV RAILS_ENV=production
COPY Gemfile Gemfile.lock /campo/
RUN bundle install --deployment --without test development && \
rm vendor/bundle/ruby/2.5.0/cache/*
COPY . /campo/
RUN bin/rails assets:precompile && \
yarn cache clean && \
rm -rf node_modules tmp/cache/* /tmp/*