Kouhei Sutou
null+****@clear*****
Tue Jul 11 16:02:30 JST 2017
Kouhei Sutou 2017-07-11 16:02:30 +0900 (Tue, 11 Jul 2017) New Revision: 12e67242bae73835ea221783175e71596a92c0d0 https://github.com/ranguba/chupa-text-docker/commit/12e67242bae73835ea221783175e71596a92c0d0 Message: Make workable Added files: chupa-text/Dockerfile Copied files: chupa-text/home/chupa-text/chupa-text-http-server/Gemfile.local (from files/home/chupa-text/chupa-text-http-server/Gemfile.local) chupa-text/home/chupa-text/chupa-text-http-server/start.sh (from files/home/chupa-text/chupa-text-http-server/Gemfile.local) docker-compose.yml (from files/home/chupa-text/chupa-text-http-server/Gemfile.local) proxy/Dockerfile (from files/home/chupa-text/chupa-text-http-server/Gemfile.local) Removed files: Dockerfile Renamed files: chupa-text/etc/sudoers.d/no-password (from files/etc/sudoers.d/no-password) proxy/start.sh (from files/home/chupa-text/chupa-text-http-server/Gemfile.local) Deleted: Dockerfile (+0 -48) 100644 =================================================================== --- Dockerfile 2017-07-10 18:23:49 +0900 (0234550) +++ /dev/null @@ -1,48 +0,0 @@ -FROM ubuntu:17.04 -MAINTAINER groonga - -RUN \ - apt update && \ - apt install -y -V \ - g++ \ - gcc \ - git \ - libreoffice \ - make \ - ruby \ - ruby-dev \ - sudo \ - xvfb \ - zlib1g-dev && \ - rm -rf /var/lib/apt/lists/* && \ - rm -rf /var/cache/apt/archives/* - -RUN gem install bundler - -COPY \ - files/etc/sudoers.d/* \ - /etc/sudoers.d/ - -RUN \ - useradd \ - --create-home \ - chupa-text -RUN adduser chupa-text sudo - -USER chupa-text -WORKDIR /home/chupa-text - -RUN git clone --depth 1 https://github.com/ranguba/chupa-text-http-server.git - -COPY \ - files/home/chupa-text/chupa-text-http-server/* \ - /home/chupa-text/chupa-text-http-server/ - -WORKDIR /home/chupa-text/chupa-text-http-server -RUN \ - sudo apt update && \ - bundle install && \ - sudo rm -rf /var/lib/apt/lists/* && \ - sudo rm -rf /var/cache/apt/archives/* - -ENV PATH=/var/lib/gems/2.3.0/bin:$PATH Added: chupa-text/Dockerfile (+87 -0) 100644 =================================================================== --- /dev/null +++ chupa-text/Dockerfile 2017-07-11 16:02:30 +0900 (1eca46f) @@ -0,0 +1,87 @@ +# Copyright (C) 2017 Kouhei Sutou <kou �� clear-code.com> +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +FROM ubuntu:17.04 +MAINTAINER groonga + +RUN ln -fs /usr/share/zoneinfo/Asia/Tokyo /etc/localtime + +RUN \ + apt update && \ + apt install -y -V \ + apache2 \ + apache2-dev \ + curl \ + g++ \ + gcc \ + git \ + libapr1-dev \ + libaprutil1-dev \ + libcurl4-openssl-dev \ + libreoffice \ + libssl-dev \ + make \ + nodejs \ + nodejs-legacy \ + npm \ + ruby \ + ruby-dev \ + sudo \ + tzdata \ + xvfb \ + zlib1g-dev && \ + rm -rf /var/lib/apt/lists/* && \ + rm -rf /var/cache/apt/archives/* + +RUN gem install bundler +RUN npm install -g yarn + +COPY \ + etc/sudoers.d/* \ + /etc/sudoers.d/ + +RUN \ + useradd \ + --create-home \ + chupa-text +RUN adduser chupa-text sudo + +USER chupa-text +WORKDIR /home/chupa-text + +ENV RAILS_ENV=production +ENV PATH=/var/lib/gems/2.3.0/bin:$PATH + +RUN git clone --depth 2 https://github.com/ranguba/chupa-text-http-server.git + +COPY \ + home/chupa-text/chupa-text-http-server/* \ + /home/chupa-text/chupa-text-http-server/ +RUN \ + sudo chown -R chupa-text:chupa-text \ + /home/chupa-text/chupa-text-http-server/ + +WORKDIR /home/chupa-text/chupa-text-http-server +RUN \ + sudo apt update && \ + bundle install --without development test && \ + sudo rm -rf /var/lib/apt/lists/* && \ + sudo rm -rf /var/cache/apt/archives/* + +RUN \ + RAILS_ENV=production bin/rails assets:precompile + +CMD /bin/bash Renamed: chupa-text/etc/sudoers.d/no-password (+0 -0) 100% =================================================================== Copied: chupa-text/home/chupa-text/chupa-text-http-server/Gemfile.local (+0 -0) 100% =================================================================== Copied: chupa-text/home/chupa-text/chupa-text-http-server/start.sh (+11 -5) 78% Mode: 100644 -> 100755 =================================================================== --- files/home/chupa-text/chupa-text-http-server/Gemfile.local 2017-07-10 18:23:49 +0900 (d435176) +++ chupa-text/home/chupa-text/chupa-text-http-server/start.sh 2017-07-11 16:02:30 +0900 (d6755af) @@ -1,4 +1,4 @@ -# -*- ruby -*- +#!/bin/sh # # Copyright (C) 2017 Kouhei Sutou <kou �� clear-code.com> # @@ -16,7 +16,13 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -gem "chupa-text-decomposer-html" -gem "chupa-text-decomposer-webkit" -gem "chupa-text-decomposer-libreoffice" -gem "chupa-text-decomposer-pdf" +set -e +set -u + +sudo -H chown -R $(id --name --user):$(id --name --group) log + +(echo "production:"; \ + echo " secret_key_base: $(bin/rails secret)") > \ + config/secrets.yml + +xvfb-run bin/rails server Copied: docker-compose.yml (+28 -6) 57% =================================================================== --- files/home/chupa-text/chupa-text-http-server/Gemfile.local 2017-07-10 18:23:49 +0900 (d435176) +++ docker-compose.yml 2017-07-11 16:02:30 +0900 (572c65d) @@ -1,5 +1,3 @@ -# -*- ruby -*- -# # Copyright (C) 2017 Kouhei Sutou <kou �� clear-code.com> # # This library is free software; you can redistribute it and/or @@ -16,7 +14,31 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -gem "chupa-text-decomposer-html" -gem "chupa-text-decomposer-webkit" -gem "chupa-text-decomposer-libreoffice" -gem "chupa-text-decomposer-pdf" +version: "3.3" + +services: + proxy: + build: + context: proxy + command: + - ./start.sh + ports: + - 3128:3128 + volumes: + - /var/log/chupa-text/proxy:/var/log/squid:z + chupa-text: + build: + context: chupa-text + # cache_from: + # - groonga/chupa-text:latest + command: + - ./start.sh + ports: + - 20080:3000 + environment: + http_proxy: http://proxy:3128/ + https_proxy: http://proxy:3128/ + volumes: + - /var/log/chupa-text/rails:/home/chupa-text/chupa-text-http-server/log:z + depends_on: + - proxy Copied: proxy/Dockerfile (+15 -6) 75% =================================================================== --- files/home/chupa-text/chupa-text-http-server/Gemfile.local 2017-07-10 18:23:49 +0900 (d435176) +++ proxy/Dockerfile 2017-07-11 16:02:30 +0900 (01770d2) @@ -1,5 +1,3 @@ -# -*- ruby -*- -# # Copyright (C) 2017 Kouhei Sutou <kou �� clear-code.com> # # This library is free software; you can redistribute it and/or @@ -16,7 +14,18 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -gem "chupa-text-decomposer-html" -gem "chupa-text-decomposer-webkit" -gem "chupa-text-decomposer-libreoffice" -gem "chupa-text-decomposer-pdf" +FROM ubuntu:17.04 +MAINTAINER groonga + +RUN ln -fs /usr/share/zoneinfo/Asia/Tokyo /etc/localtime + +RUN \ + apt update && \ + apt install -y -V \ + squid && \ + rm -rf /var/lib/apt/lists/* && \ + rm -rf /var/cache/apt/archives/* + +COPY start.sh / + +CMD /bin/bash Renamed: proxy/start.sh (+15 -5) 79% Mode: 100644 -> 100755 =================================================================== --- files/home/chupa-text/chupa-text-http-server/Gemfile.local 2017-07-10 18:23:49 +0900 (d435176) +++ proxy/start.sh 2017-07-11 16:02:30 +0900 (bd600aa) @@ -1,4 +1,4 @@ -# -*- ruby -*- +#!/bin/sh # # Copyright (C) 2017 Kouhei Sutou <kou �� clear-code.com> # @@ -16,7 +16,17 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -gem "chupa-text-decomposer-html" -gem "chupa-text-decomposer-webkit" -gem "chupa-text-decomposer-libreoffice" -gem "chupa-text-decomposer-pdf" +set -e +set -u + +chown -R proxy:proxy /var/log/squid + +umask 027 +ulimit -n 65535 + +sed \ + -i'' \ + -e 's/^http_access deny all/http_access allow all/g' \ + /etc/squid/squid.conf + +/usr/sbin/squid -N -------------- next part -------------- HTML����������������������������... Télécharger