-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
51 lines (38 loc) · 1.02 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
# base image
FROM ruby:3.0.4
MAINTAINER Martin Hinz <[email protected]>
# install node and yarn
RUN curl -fsSL https://deb.nodesource.com/setup_16.x | bash -
RUN apt-get install -y --no-install-recommends build-essential nodejs libboost-all-dev
RUN corepack enable
# install additional system utilities
RUN apt-get install -y cron nano
# throw errors if Gemfile has been modified since Gemfile.lock
RUN bundle config --global frozen 1
# change workdir
WORKDIR /application
# gemfile into container
RUN mkdir -p .
ADD Gemfile .
ADD Gemfile.lock .
# update bundler
RUN gem install bundler
# bundle install
RUN bundle config set --local system 'true'
RUN bundle install
# copy app into container
ADD . .
# initialize log
RUN mkdir -p ./log
RUN cat /dev/null > ./log/production.log
RUN chmod -R a+w ./log
# Port
EXPOSE 3000
# set environment variables
ENV RAILS_ENV=production
# permission management
RUN chmod +x ./entrypoint.sh
RUN mkdir -p ./tmp
RUN chown -R nobody:nogroup ./tmp
# define entrypoint
ENTRYPOINT ./entrypoint.sh