-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
40 lines (33 loc) · 1.61 KB
/
Dockerfile
File metadata and controls
40 lines (33 loc) · 1.61 KB
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
FROM ruby:2.3.3-alpine
MAINTAINER Tsukasa Arima
ARG DOCKERIZE_VERSION=v0.3.0
ENV RAILS_ENV=production RACK_ENV=production PATH=/usr/src/app/bin:$PATH
RUN set -x \
&& mkdir -p /usr/src/app \
&& apk add --update --upgrade --no-cache --virtual .rails-dependency-packages \
ruby-dev zlib-dev libxml2-dev libxml2-utils libxslt-dev tzdata yaml-dev \
readline-dev libpq bash \
&& apk add --update --upgrade --no-cache --virtual .dockerize-packages \
ca-certificates wget \
&& wget https://github.com/jwilder/dockerize/releases/download/${DOCKERIZE_VERSION}/dockerize-linux-amd64-${DOCKERIZE_VERSION}.tar.gz \
&& tar -C /usr/local/bin -xzvf dockerize-linux-amd64-${DOCKERIZE_VERSION}.tar.gz \
&& rm dockerize-linux-amd64-${DOCKERIZE_VERSION}.tar.gz \
&& apk del .dockerize-packages
COPY Gemfile* /usr/src/app/
COPY docker-entrypoint.sh /usr/local/bin/
RUN set -x \
&& chmod u+x /usr/local/bin/docker-entrypoint.sh \
&& apk add --update --upgrade --no-cache --virtual .build-packages openssl-dev \
ca-certificates wget curl-dev build-base alpine-sdk linux-headers paxctl \
make gcc g++ libgcc libstdc++ gnupg postgresql-dev \
&& cd /usr/src/app \
&& gem update --system \
&& gem update bundler \
&& CPU_CORES="$(cat /proc/cpuinfo | grep "cpu cores" | wc -l)" \
&& bundle install --jobs=${CPU_CORES} --retry 5 --without development test \
&& apk del .build-packages
COPY . /usr/src/app/
WORKDIR /usr/src/app
ENTRYPOINT ["docker-entrypoint.sh"]
CMD ["unicorn", "-c", "/usr/src/app/config/unicorn.rb", "-E", "production", "-o", "0.0.0.0"]
EXPOSE 9000