Skip to content

Commit 695cc67

Browse files
committed
add dockerfile
1 parent c8f841c commit 695cc67

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

app.Dockerfile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
FROM ruby:3.0.0
2+
3+
# Install node 14-LTS and yarn
4+
RUN curl -sL https://deb.nodesource.com/setup_14.x | bash -
5+
RUN apt-get update -qq && apt-get install -qq --no-install-recommends \
6+
nodejs \
7+
&& apt-get clean \
8+
&& rm -rf /var/lib/apt/lists/*
9+
RUN npm install -g yarn@1
10+
11+
WORKDIR /app
12+
COPY Gemfile /app/Gemfile
13+
COPY Gemfile.lock /app/Gemfile.lock
14+
RUN bundle install
15+
COPY . /app
16+
17+
EXPOSE 3000
18+
19+
RUN SECRET_KEY_BASE=1 RAILS_ENV=production bundle exec rake assets:precompile
20+
CMD ["bundle", "exec", "puma", "-C", "config/puma.rb"]

nginx.Dockerfile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
FROM nginx
2+
3+
RUN apt-get update -qq && apt-get -y install apache2-utils
4+
5+
ENV RAILS_ROOT /app
6+
WORKDIR $RAILS_ROOT
7+
8+
RUN mkdir log
9+
COPY public public/
10+
COPY nginx.conf /tmp/docker.nginx
11+
12+
RUN envsubst '$RAILS_ROOT' < /tmp/docker.nginx > /etc/nginx/conf.d/default.conf
13+
14+
EXPOSE 80
15+
CMD [ "nginx", "-g", "daemon off;" ]

0 commit comments

Comments
 (0)