forked from parada1104/docker-rails
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
69 lines (63 loc) · 1.32 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
FROM ruby:2.7.1-alpine as dev-build
RUN apk add --update --virtual \
runtime-deps \
postgresql-client \
build-base \
libxml2-dev \
libxslt-dev \
nodejs \
yarn \
libffi-dev \
readline \
build-base \
postgresql-dev \
libc-dev \
linux-headers \
readline-dev \
file \
imagemagick \
git \
tzdata \
python2 \
vim \
&& rm -rf /var/cache/apk/*
WORKDIR /myapp
COPY . .
COPY /Gemfile /Gemfile
COPY /Gemfile.lock /Gemfile.lock
RUN gem install foreman
RUN yarn install
RUN bundle install
CMD ["foreman", "start", "-f", "Procfile.dev"]
EXPOSE 5000
FROM ruby:2.7.1-alpine as prod-build
RUN apk add --update --virtual \
runtime-deps \
postgresql-client \
build-base \
libxml2-dev \
libxslt-dev \
nodejs \
yarn \
libffi-dev \
readline \
postgresql-dev \
libc-dev \
linux-headers \
readline-dev \
file \
git \
tzdata \
python2 \
vim \
&& rm -rf /var/cache/apk/*
# Set working directory, where the commands will be ran:
WORKDIR /myapp
COPY . .
RUN gem install foreman
RUN yarn install --production
RUN bundle install --jobs 20 --retry 5 --without development test
ENTRYPOINT [ "./production-entrypoint.sh" ]
RUN chmod +x ./production-entrypoint.sh
EXPOSE 5000
CMD ["foreman", "start", "-f", "Procfile"]