Selaa lähdekoodia

over complicate docker

master
Cian Butler 3 vuotta sitten
vanhempi
commit
6050ec5197
Allekirjoittanut: butlerx GPG Key ID: B37CA765BAA89170
3 muutettua tiedostoa jossa 63 lisäystä ja 13 poistoa
  1. +23
    -11
      Dockerfile
  2. +2
    -2
      Makefile
  3. +38
    -0
      config.ru

+ 23
- 11
Dockerfile Näytä tiedosto

@@ -1,12 +1,24 @@
FROM ruby:alpine
RUN apk --no-cache --update add git \
icu-dev \
ruby-dev \
libstdc++ \
libffi-dev \
build-base \
cmake && \
gem install github-linguist gollum org-ruby
FROM ruby:slim-jessie
RUN apt-get update && \
apt-get install -y -q \
build-essential \
cmake \
make \
cron \
git-core \
libicu-dev \
zlib1g-dev && \
apt-get clean && \
rm -rf /var/cache/apt/archives/* /var/lib/apt/lists/* && \
gem install --no-ri --no-rdoc \
github-linguist \
org-ruby \
gollum \
github-markdown \
rack-cache && \
sed -i \
's/\[tmode, obj.name, sha\]/\[tmode, obj.name.force_encoding("ASCII-8BIT"), sha\]/g' \
/var/lib/gems/1.9.1/gems/gitlab-grit-2.7.2/lib/grit/index.rb
EXPOSE 9292
WORKDIR /wiki
ENTRYPOINT ["gollum", "--port", "80"]
EXPOSE 80
CMD ["rackup", "-E", "deployment"]

+ 2
- 2
Makefile Näytä tiedosto

@@ -14,5 +14,5 @@ push:
docker push $(PREFIX)/$(IMAGE):$(TAG)

start:
@echo 'Starting wiki on localhost:4567'
docker run -v $(DIR):/wiki -p 4567:80 $(PREFIX)/$(IMAGE):$(TAG)
@echo 'Starting wiki on localhost:9292'
docker run -v $(DIR):/wiki -p 9292:9292 $(PREFIX)/$(IMAGE):$(TAG)

+ 38
- 0
config.ru Näytä tiedosto

@@ -0,0 +1,38 @@
require 'rubygems'
require 'gollum/app'
require 'rack'
require 'rack/cache'

### start gollum with `rackup`

set :environment, :production

gollum_path = File.expand_path(File.dirname(__FILE__))
Precious::App.set(:gollum_path, gollum_path)
Precious::App.set(:base_path, 'wiki')
Precious::App.set(
:wiki_options,
{
:css => true,
:js => true,
:live_preview => false
}
)


# Add in commit user/email
class Precious::App
before do
session['gollum.author'] = {
:name => "%s" % [env['HTTP_X_PROXY_REMOTE_USER_NAME']],
:email => "%s" % env['HTTP_X_PROXY_REMOTE_USER_MAIL'],
}
end
end


# since --base-path does not work with rack
map '/wiki' do
run Precious::App
end


Ladataan…
Peruuta
Tallenna