-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
92 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
FROM openjdk:8-jre-alpine | ||
ENV AOZORA_EPUB3 AozoraEpub3-1.1.0b46.zip | ||
ENV KINDLEGEN kindlegen_linux_2.6_i386_v2_9.tar.gz | ||
ENV NAROU_VERSION 3.1.1 | ||
WORKDIR /opt/narou | ||
|
||
RUN apk --update add ruby ruby-io-console ruby-json wget unzip && rm -rf /var/cache/apk/* | ||
|
||
RUN wget https://github.com/jam7/AozoraEpub3/releases/download/1.1.0b46/${AOZORA_EPUB3} -O /opt/AozoraEpub3.zip | ||
|
||
RUN wget http://kindlegen.s3.amazonaws.com/${KINDLEGEN} && \ | ||
mkdir -p /opt/kindlegen && \ | ||
tar zxf ${KINDLEGEN} -C /opt/kindlegen && \ | ||
rm ${KINDLEGEN} | ||
|
||
RUN gem install narou -v ${NAROU_VERSION} --no-document | ||
|
||
COPY init.sh /usr/local/bin | ||
|
||
ENTRYPOINT ["init.sh"] | ||
CMD ["narou", "web", "-p", "8000", "-n"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
|
||
OPTIONS = \ | ||
--build-arg http_proxy=${http_proxy} \ | ||
--build-arg https_proxy=${https_proxy} \ | ||
--build-arg ftp_proxy=${ftp_proxy} \ | ||
--build-arg no_proxy=${no_proxy} | ||
|
||
build: FORCE | ||
docker build -t jam7/narou-alpine ${OPTIONS} . | ||
|
||
FORCE: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# narou-docker-alpine | ||
A narou.rb in docker using alpine / narou.rbをalpine linuxで実行するためのdocker環境 | ||
|
||
## Prerequisite | ||
|
||
Need to install docker. | ||
|
||
## Install | ||
|
||
In order to use this, installation is not really needed. There is docker image in public. | ||
|
||
``` | ||
$ docker pull jam7/narou-alpine | ||
``` | ||
|
||
## Build | ||
|
||
In order to build image by yourself, perform `make` | ||
|
||
``` | ||
$ make | ||
``` | ||
|
||
## Usage | ||
|
||
It is easy to use through [narou-docker-script](https://github.com/jam7/narou-docker-script). | ||
|
||
## Where is data directory | ||
|
||
All data are stored in `/opt/narou`. So use `docker run -v $HOME/.narou:/opt/narou ...` command to use your `$HOME/.narou` as data directory. | ||
|
||
## Run as web service | ||
|
||
Use `docker run -p IP-ADDRESS:8000:8000 narou web -p 8000 -n`. | ||
|
||
## License | ||
|
||
@ 2016-2017 Kazushi (Jam) Marukawa, All rights reserved. | ||
|
||
This project including all of its source files is released under the terms of [GNU General Public License (version 3 or later)](http://www.gnu.org/licenses/gpl.txt) | ||
|
||
## Related projects | ||
|
||
narou.rb is in https://github.com/whiteleaf7/narou. | ||
narou-docker is in https://github.com/migimigi/narou-docker. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/sh | ||
|
||
if [ ! -d "/opt/narou/.narou" ]; then | ||
mkdir /opt/narou/.narousetting | ||
unzip /opt/AozoraEpub3.zip -d /opt/narou/AozoraEpub3 | ||
ln -s /opt/kindlegen/kindlegen /opt/AozoraEpub3 | ||
narou init -p /opt/narou/AozoraEpub3 | ||
narou setting device=kindle | ||
narou setting server-bind=* | ||
echo -e "---\nalready-server-boot: true" > /opt/narou/.narousetting/server_setting.yaml | ||
fi | ||
|
||
exec "$@" |