This repository has been archived by the owner on Mar 24, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
55 lines (42 loc) · 2.01 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
FROM ruby:2.6.3
MAINTAINER YAMADA Tsuyoshi <[email protected]>
ENV TDIARY_CORE_VERSION=v5.0.14
ENV TDIARY_CONTRIB_VERSION=v5.0.13
ENV TDIARY_CACHE_NULL_VERSION=v0.1.2
ENV TDIARY_IO_RDB_VERSION=v0.0.2
ENV TDIARY_STYLE_GFM_VERSION=v1.2.0
ENV MAGELLAN_PROXY_VERSION=0.1.9
## install tdiary-core to /usr/src/app
RUN git clone -b ${TDIARY_CORE_VERSION} https://github.com/tdiary/tdiary-core.git /usr/src/app
RUN cd /usr/src/app && bundle install --jobs=4 --without=development:test
## install libidn11-dev package
## (tdiary-style-gfm gem depends on twitter-text gem, twitter-text gem depends on idn-ruby gem)
RUN apt-get update && \
apt-get install -y --no-install-recommends libidn11-dev
## customize tdiary
ADD build /build
RUN cp -a /build/Gemfile.local /usr/src/app/ && cd /usr/src/app && bundle install
RUN cp -a /build/tdiary.conf /usr/src/app/
RUN cp -a /build/config.ru /usr/src/app/
## copy js, theme to public/assets
RUN cd /usr/src/app && bin/tdiary assets_copy
## download Phusion Passenger agent binary
RUN passenger start --runtime-check-only
## install entrypoint script, and utility
RUN install -m 755 -o root -g root -p -D /build/entrypoint /opt/magellan-tdiary/entrypoint
RUN install -m 644 -o root -g root -p -D /build/Rakefile /opt/magellan-tdiary/Rakefile
## install magellan-proxy
ADD https://github.com/groovenauts/magellan-proxy/releases/download/v${MAGELLAN_PROXY_VERSION}/magellan-proxy-${MAGELLAN_PROXY_VERSION}_linux-amd64 /usr/local/bin/magellan-proxy
RUN chmod +x /usr/local/bin/magellan-proxy
## cleanup
RUN rm -rf /build
ENV RACK_MINI_PROFILER_ENABLED true
ENV RUBY_GC_PROFILER_ENABLED true
ENV TDIARY_BASIC_AUTH_USERNAME tdiary
ENV TDIARY_BASIC_AUTH_PASSWORD tdiary
ENV TIMEZONE Asia/Tokyo
WORKDIR /usr/src/app
ENTRYPOINT ["/opt/magellan-tdiary/entrypoint"]
CMD [ "magellan-proxy", "-n", "5", \
"bundle", "exec", "passenger", "start", "-p", "80", "-e", "production", "--max-pool-size", "3", \
"--pid-file", "tmp/passenger.pid", "--load-shell-envvars", "--static-files-dir", "public" ]