Skip to content
Snippets Groups Projects
Dockerfile 1.27 KiB
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"
    
    
        RAILS_SERVE_STATIC_FILES=true \
    
        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 \
    
     && apk -U upgrade \
     && apk add -t build-dependencies \
        build-base \
    
    Wonderfall's avatar
    Wonderfall committed
        libxml2-dev \
        libxslt-dev \
    
        postgresql-dev \
        protobuf-dev \
    
     && apk add \
        ca-certificates \
        ffmpeg \
        file \
    
        imagemagick@edge \
    
    Wonderfall's avatar
    Wonderfall committed
        libpq \
        libxml2 \
        libxslt \
    
        nodejs-npm@edge \
        nodejs@edge \
    
    Akihiko Odaki's avatar
    Akihiko Odaki committed
        protobuf \
    
    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
    
    
    COPY docker_entrypoint.sh /usr/local/bin/run
    
    RUN chmod +x /usr/local/bin/run
    
    
    VOLUME /mastodon/public/system /mastodon/public/assets /mastodon/public/packs
    
    
    ENTRYPOINT ["/usr/local/bin/run"]