-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
45 lines (37 loc) · 1.25 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
FROM ruby:3.0.0-slim-buster as build-image
# Install container dependencies
ENV BUILD_PACKAGES="wget gnupg2 libgmp-dev make gcc patch g++"
RUN set -eux; \
apt-get update -qq; \
apt-get install -y --no-install-recommends $BUILD_PACKAGES; \
rm -rf /var/lib/apt/lists/*
# Install app dependencies
ENV APP_PACKAGES="postgresql-client-13 libpq-dev zlib1g-dev liblzma-dev"
RUN set -eux; \
echo "deb http://apt.postgresql.org/pub/repos/apt/ buster-pgdg main" > /etc/apt/sources.list.d/pgdg.list; \
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -; \
apt-get update -qq; \
apt-get install -y --no-install-recommends $APP_PACKAGES; \
rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY Gemfile* ./
COPY .ruby-version .
RUN gem install bundler --version 2.2.3 --quiet
RUN bundle install --with production --without development test --quiet
FROM build-image as default-image
COPY app/ ./app/
COPY bin/ ./bin/
COPY config/ ./config/
COPY db/ ./db/
COPY lib/ ./lib/
COPY public/ ./public/
RUN mkdir -p ./tmp/pids
COPY vendor/ ./vendor/
COPY config.ru .
COPY Rakefile .
ENV LANG=en_US.UTF-8
ENV RACK_ENV=production
ENV RAILS_ENV=production
ENV RAILS_LOG_TO_STDOUT=enabled
EXPOSE 3000
CMD bundle exec puma --config config/puma.rb