2019-07-17 20:10:46 +00:00
|
|
|
FROM cloudron/base:1.0.0@sha256:147a648a068a2e746644746bbfb42eb7a50d682437cead3c67c933c546357617
|
2018-10-30 15:46:13 +00:00
|
|
|
|
2020-01-06 19:21:25 +00:00
|
|
|
RUN mkdir -p /app/code /app/pkg
|
2018-10-30 15:46:13 +00:00
|
|
|
WORKDIR /app/code
|
|
|
|
|
2020-02-09 15:43:01 +00:00
|
|
|
ARG VERSION=3.1.2
|
2019-12-12 22:11:35 +00:00
|
|
|
|
2019-07-17 21:14:32 +00:00
|
|
|
RUN apt-key adv --fetch-keys http://dl.yarnpkg.com/debian/pubkey.gpg && \
|
|
|
|
echo "deb http://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list && \
|
|
|
|
apt-get update && \
|
|
|
|
apt-get install -y yarn libprotobuf-dev protobuf-compiler libidn11-dev libicu-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm5 libgdbm-dev libicu-dev libssl-dev libyaml-dev libreadline6-dev libxml2-dev libxslt1-dev && \
|
|
|
|
rm -rf /var/cache/apt /var/lib/apt/lists
|
2018-10-30 15:46:13 +00:00
|
|
|
|
2019-07-17 21:14:32 +00:00
|
|
|
RUN mkdir -p /usr/local/node-10.15.3 && \
|
|
|
|
curl -L https://nodejs.org/dist/v10.15.3/node-v10.15.3-linux-x64.tar.gz | tar zxf - --strip-components 1 -C /usr/local/node-10.15.3
|
2018-10-30 15:46:13 +00:00
|
|
|
|
2019-07-17 21:14:32 +00:00
|
|
|
ENV PATH /usr/local/node-10.15.3/bin:$PATH
|
2018-10-30 15:46:13 +00:00
|
|
|
|
2020-02-09 15:43:01 +00:00
|
|
|
RUN gem install --no-document bundler
|
2018-10-30 15:46:13 +00:00
|
|
|
|
2019-07-17 21:14:32 +00:00
|
|
|
ENV RAILS_ENV production
|
|
|
|
ENV NODE_ENV production
|
|
|
|
RUN curl -L https://github.com/tootsuite/mastodon/archive/v${VERSION}.tar.gz | tar -xz --strip-components 1 -f - && \
|
2020-02-09 15:43:01 +00:00
|
|
|
bundle config set deployment 'true' && \
|
|
|
|
bundle install --without test development && \
|
2019-07-17 21:14:32 +00:00
|
|
|
yarn install --pure-lockfile
|
2018-10-30 15:46:13 +00:00
|
|
|
|
|
|
|
# secret keys are not built into assets, so precompiling is safe to do here
|
|
|
|
# (these variables are required by rake though)
|
|
|
|
RUN SECRET_KEY_BASE=insecure.secret_key_base OTP_SECRET=insecure.otp_secret \
|
|
|
|
bundle exec rake assets:precompile
|
|
|
|
|
2019-07-17 21:14:32 +00:00
|
|
|
# add nginx config
|
|
|
|
USER root
|
|
|
|
RUN rm /etc/nginx/sites-enabled/*
|
|
|
|
RUN ln -sf /dev/stdout /var/log/nginx/access.log
|
|
|
|
RUN ln -sf /dev/stderr /var/log/nginx/error.log
|
|
|
|
ADD nginx_readonlyrootfs.conf /etc/nginx/conf.d/readonlyrootfs.conf
|
|
|
|
COPY nginx/mastodon.conf /etc/nginx/sites-available/mastodon
|
|
|
|
RUN ln -s /etc/nginx/sites-available/mastodon /etc/nginx/sites-enabled/mastodon
|
|
|
|
|
|
|
|
# add supervisor configs
|
|
|
|
ADD supervisor/* /etc/supervisor/conf.d/
|
|
|
|
RUN ln -sf /run/mastodon/supervisord.log /var/log/supervisor/supervisord.log
|
|
|
|
|
|
|
|
RUN ln -fs /app/data/env.production /app/code/.env.production
|
|
|
|
RUN ln -fs /run/mastodon/bullet.log /app/code/log/bullet.log
|
2018-10-30 15:46:13 +00:00
|
|
|
RUN ln -fs /app/data/system /app/code/public/system
|
2019-07-17 21:14:32 +00:00
|
|
|
RUN rm -rf /app/code/tmp && ln -fs /tmp/mastodon /app/code/tmp
|
|
|
|
|
2020-01-06 19:21:25 +00:00
|
|
|
COPY start.sh env.template /app/pkg/
|
2018-10-31 12:53:10 +00:00
|
|
|
|
2020-01-06 19:21:25 +00:00
|
|
|
CMD [ "/app/pkg/start.sh" ]
|
2018-10-30 15:46:13 +00:00
|
|
|
|