-
Notifications
You must be signed in to change notification settings - Fork 14
/
Dockerfile.fly
44 lines (35 loc) · 1 KB
/
Dockerfile.fly
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
FROM ruby:3.2.2-bullseye
ENV BUNDLE_JOBS=4
ENV BUNDLE_RETRY=3
ENV BUNDLE_PATH="vendor/bundle"
ENV BUNDLE_DEPLOYMENT="true"
ENV BUNDLE_WITHOUT="test development"
ENV RAILS_ENV=production
ENV RAILS_SERVE_STATIC_FILES=true
ENV RAILS_LOG_TO_STDOUT=true
RUN apt-get update -qq \
&& apt-get install -y \
nodejs \
npm \
postgresql-client \
esbuild \
&& rm -rf /var/lib/apt/lists/*
RUN mkdir /project
WORKDIR /project
COPY .ruby-version Gemfile Gemfile.lock /project/
RUN gem update --system \
&& gem install bundler -v $(grep -A 1 "BUNDLED WITH" Gemfile.lock | tail -1 | tr -d " ") \
&& bundle install
COPY .node-version package.json yarn.lock /project/
RUN echo "Installing node $(cat .node-version)" \
&& npm install -g n \
&& n $(cat .node-version)
RUN npm install -g yarn
RUN yarn install
COPY . /project
ENV SECRET_KEY_BASE 1
RUN bin/rails assets:precompile
ENV PORT 8080
ARG SERVER_COMMAND="bin/rails server"
ENV SERVER_COMMAND ${SERVER_COMMAND}
CMD ${SERVER_COMMAND}