-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
48 lines (37 loc) · 1.23 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
46
47
48
# Image for wkhtmltopdf with patched qt.
FROM ruby:2.7-alpine3.11
LABEL maintainer "Petteri Heinonen <[email protected]>"
ARG RAILS_ENV=development
RUN apk update && apk --update add \
pkgconfig \
tzdata \
potrace \
ttf-freefont \
font-noto \
fontconfig \
nodejs-lts \
git
# version lock postgresql tools to the db version
RUN apk add --repository http://dl-cdn.alpinelinux.org/alpine/v3.4/main/ postgresql~=9.5
# Setup Rails application
# =======================
WORKDIR /tmp
ADD Gemfile Gemfile.lock /tmp/
RUN echo "gem: --no-document" >> ~/.gemrc && \
cp ~/.gemrc /etc/gemrc && chmod uog+r /etc/gemrc && \
apk update && \
apk --update add --virtual build-dependencies gcc g++ make \
postgresql-dev && \
gem update --system 3.1.4 && \
gem install bundler -v '2.1.4' && \
bundle install && \
apk del build-dependencies
ENV APP_DIR /app
RUN mkdir $APP_DIR
WORKDIR $APP_DIR
ADD . $APP_DIR
# Create mountpoint for shared files between containers
RUN mkdir /share
RUN RAILS_ENV=$RAILS_ENV SECRET_KEY_BASE=dummy REDIS_ENDPOINT=dummy DATABASE_URL=postgres://dummy:dummy@dummy/dummy bundle exec rake assets:clobber assets:precompile
EXPOSE 3000
CMD ["rails", "server", "-b", "[::]"]