Skip to content
Snippets Groups Projects
Dockerfile 1019 B
Newer Older
FROM ruby:2.4.1-alpine
Wonderfall's avatar
Wonderfall committed
LABEL maintainer="https://github.com/tootsuite/mastodon" \
      description="A GNU Social-compatible microblogging server"

Wonderfall's avatar
Wonderfall committed
ENV RAILS_ENV=production \
    NODE_ENV=production
Wonderfall's avatar
Wonderfall committed
EXPOSE 3000 4000

RUN echo "@edge https://nl.alpinelinux.org/alpine/edge/main" >> /etc/apk/repositories \
 && BUILD_DEPS=" \
Wonderfall's avatar
Wonderfall committed
    postgresql-dev \
    libxml2-dev \
    libxslt-dev \
Wonderfall's avatar
Wonderfall committed
    build-base" \
 && apk -U upgrade && apk add \
    $BUILD_DEPS \
    nodejs@edge \
    nodejs-npm@edge \
Wonderfall's avatar
Wonderfall committed
    libpq \
    libxml2 \
    libxslt \
    ffmpeg \
    file \
    imagemagick@edge \
Wonderfall's avatar
Wonderfall committed
 && npm install -g npm@3 && npm install -g yarn \
 && update-ca-certificates \
Wonderfall's avatar
Wonderfall committed
 && rm -rf /tmp/* /var/cache/apk/*
COPY Gemfile Gemfile.lock package.json yarn.lock /mastodon/

RUN bundle install --deployment --without test development \
 && yarn --ignore-optional --pure-lockfile

Ryan Wade's avatar
Ryan Wade committed
COPY . /mastodon

VOLUME /mastodon/public/system /mastodon/public/assets /mastodon/public/packs