forked from cookpad/sisito
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.sisito
75 lines (62 loc) · 1.95 KB
/
Dockerfile.sisito
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
FROM ubuntu:jammy-20221003
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && \
apt-get install -y --no-install-recommends \
build-essential \
ruby \
ruby-dev \
libxml2-dev \
libxslt-dev \
wget \
mysql-client \
libmysqlclient-dev \
curl \
nodejs \
libsqlite3-dev \
liblzma-dev \
zlib1g-dev \
libssl-dev \
libreadline-dev \
libyaml-dev \
libxslt1-dev \
libcurl4-openssl-dev \
software-properties-common \
libffi-dev \
tzdata && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
RUN cp /usr/share/zoneinfo/Asia/Tokyo /etc/localtime
RUN dpkg-reconfigure -f noninteractive tzdata
RUN gem install bundler mailcatcher bootstrap-sass
ARG ENTRYKIT_VERSION=0.4.0
RUN wget -O- -q https://github.com/progrium/entrykit/releases/download/v${ENTRYKIT_VERSION}/entrykit_${ENTRYKIT_VERSION}_Linux_x86_64.tgz | tar zxf - && \
mv entrykit /bin/entrykit && \
chmod +x /bin/entrykit && \
entrykit --symlink
ARG DUMB_INIT_VERSION=1.0.3
RUN wget -q https://github.com/Yelp/dumb-init/releases/download/v${DUMB_INIT_VERSION}/dumb-init_${DUMB_INIT_VERSION}_amd64.deb && \
dpkg -i dumb-init_*.deb && \
rm dumb-init_*.deb
RUN mkdir /tmp/sisito
COPY Gemfile /tmp/sisito
COPY Gemfile.lock /tmp/sisito
RUN cd /tmp/sisito && \
bundle install -j4 --deployment
RUN mkdir -p /var/www/sisito/tmp/pids
COPY . /var/www/sisito
RUN sed -i '/class Application/a config.time_zone = "Tokyo"' /var/www/sisito/config/application.rb
RUN sed -i '/class Application/a config.active_record.default_timezone = :local' /var/www/sisito/config/application.rb
RUN sed -i 's/^ port: 25/ port: 1025/' /var/www/sisito/config/sisito.yml
RUN cp -a /tmp/sisito/.bundle /tmp/sisito/vendor /var/www/sisito/
COPY docker/sisito/ /
RUN chmod +x /init.sh /migrate.sh
WORKDIR /var/www/sisito
ENTRYPOINT [ \
"switch", \
"shell=/bin/bash", \
"--", \
"prehook", \
"/migrate.sh", \
"--", \
"/init.sh" \
]