This repository has been archived by the owner on Jan 12, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile
61 lines (50 loc) · 1.69 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
52
53
54
55
56
57
58
59
60
61
#
# Docker image build script for Soundstorm
#
# Use latest Ruby
FROM ruby:2.6.5-alpine
# Install system dependencies
RUN apk update
RUN apk add --no-cache --update build-base \
curl \
linux-headers \
ffmpeg \
git \
nodejs \
yarn \
tzdata \
postgresql-dev \
libsndfile-dev \
imagemagick \
yajl
# Create working directory
ENV APP_PATH=/usr/src/app
RUN mkdir -p $APP_PATH
WORKDIR $APP_PATH
# Add application dependency manifests
COPY Gemfile $APP_PATH/Gemfile
COPY Gemfile.lock $APP_PATH/Gemfile.lock
COPY package.json $APP_PATH/package.json
COPY yarn.lock $APP_PATH/yarn.lock
# Install Ruby dependencies
RUN gem update bundler
RUN bundle install --jobs `expr $(cat /proc/cpuinfo | grep -c "cpu cores") - 1` --retry 3
# Define build environment
ARG RAILS_ENV=development
ARG SECRET_KEY_BASE
ENV NODE_ENV=$RAILS_ENV \
RAILS_LOG_TO_STDOUT=true
# Install JavaScript dependencies
RUN yarn install --check-files
# Copy in application source code
COPY . $APP_PATH
# Precompile assets in production
RUN if [ "$RAILS_ENV" = "production" ] ; then rails assets:precompile; fi
# Install entrypoint script
COPY bin/entrypoint.sh /usr/bin/
RUN chmod +x /usr/bin/entrypoint.sh
ENTRYPOINT ["/usr/bin/entrypoint.sh"]
# Set up container defaults
EXPOSE 3000
CMD ["bundle", "exec", "rails", "server", "-b", "0.0.0.0"]
HEALTHCHECK CMD curl --fail "http://localhost:3000/health" || exit 1