Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
jam7 committed May 6, 2017
1 parent f2969be commit d082a2f
Show file tree
Hide file tree
Showing 4 changed files with 92 additions and 0 deletions.
21 changes: 21 additions & 0 deletions Dockerfile
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"]
11 changes: 11 additions & 0 deletions Makefile
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:
47 changes: 47 additions & 0 deletions README.md
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.


13 changes: 13 additions & 0 deletions init.sh
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 "$@"

0 comments on commit d082a2f

Please sign in to comment.