-
Notifications
You must be signed in to change notification settings - Fork 5
/
Dockerfile.production
31 lines (23 loc) · 974 Bytes
/
Dockerfile.production
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
# Development environment
FROM ruby:3.1
ENV RAILS_ENV=production
ENV INSTALL_PATH /opt/wetrockpolice
RUN mkdir -p $INSTALL_PATH
# nodejs, yarn & bun
RUN curl -sL https://deb.nodesource.com/setup_20.x | bash -
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg -o /root/yarn-pubkey.gpg && apt-key add /root/yarn-pubkey.gpg
RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list
RUN apt-get update && apt-get install -y --no-install-recommends nodejs yarn python3 python-is-python3
# set working directory
WORKDIR /opt/wetrockpolice
# instally ruby gems
COPY Gemfile Gemfile.lock ./
RUN gem install bundler
RUN bundle install --jobs 1
# install node modules
COPY package.json yarn.lock ./
RUN yarn install --check-files
COPY . .
RUN SECRET_KEY_BASE=dummy NODE_OPTIONS=--openssl-legacy-provider RAILS_ENV=production rails assets:precompile
EXPOSE 3001
CMD ["bundle", "exec", "rails", "server", "-p", "3001", "-b", "0.0.0.0"]