Skip to content
Snippets Groups Projects
Dockerfile 981 B
Newer Older
  • Learn to ignore specific revisions
  • 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
    
    
    Ryan Wade's avatar
    Ryan Wade committed
    COPY Gemfile Gemfile.lock package.json yarn.lock /mastodon/
    
    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 \
        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 \
     && bundle install --deployment --without test development \
    
     && yarn --ignore-optional \
    
     && yarn cache clean \
     && npm -g cache clean \
    
    Wonderfall's avatar
    Wonderfall committed
     && apk del $BUILD_DEPS \
     && rm -rf /tmp/* /var/cache/apk/*
    
    Ryan Wade's avatar
    Ryan Wade committed
    COPY . /mastodon
    
    
    Wonderfall's avatar
    Wonderfall committed
    VOLUME /mastodon/public/system /mastodon/public/assets