-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDockerfile.prod
More file actions
43 lines (34 loc) · 880 Bytes
/
Dockerfile.prod
File metadata and controls
43 lines (34 loc) · 880 Bytes
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
ARG CORS_ORIGINS
ARG DATABASE_HOST
ARG DATABASE_PASSWORD
ARG DATABASE_PORT
ARG DATABASE_USERNAME
ARG RAILS_ENV
ARG SECRET_KEY_BASE
ARG RUBY_VERSION=3.1.2
FROM ruby:$RUBY_VERSION-alpine
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
RUN apk add --update --no-cache \
bash \
build-base \
sudo \
libpq-dev \
tzdata
ENV CORS_ORIGINS=$CORS_ORIGINS
ENV DATABASE_HOST=$DATABASE_HOST
ENV DATABASE_PASSWORD=$DATABASE_PASSWORD
ENV DATABASE_PORT=$DATABASE_PORT
ENV DATABASE_USERNAME=$DATABASE_USERNAME
ENV SECRET_KEY_BASE=$SECRET_KEY_BASE
ENV RAILS_ENV=production
ENV RAILS_SERVE_STATIC_FILES=true
ENV RAILS_LOG_TO_STDOUT=true
RUN gem install bundler
COPY Gemfile /usr/src/app/
COPY Gemfile.lock /usr/src/app/
RUN bundle config --global frozen 1
RUN bundle install --without development test
COPY . /usr/src/app
EXPOSE 3000
ENTRYPOINT ["rails", "server", "-b", "0.0.0.0"]