Skip to content

Commit

Permalink
add docker files.
Browse files Browse the repository at this point in the history
  • Loading branch information
yast-enjoji committed Feb 2, 2017
1 parent f372885 commit 6937cec
Show file tree
Hide file tree
Showing 4 changed files with 90 additions and 0 deletions.
18 changes: 18 additions & 0 deletions Dockerfile-app
@@ -0,0 +1,18 @@
FROM ubuntu:latest

RUN apt-get update
RUN apt-get install -y scala
RUN apt-get install -y curl
RUN curl -sL https://deb.nodesource.com/setup_6.x | bash - && apt-get install -y nodejs
RUN apt-get install -y build-essential
ADD . /opt/sharedocs/

RUN touch /opt/sharedocs/sharedocsEnv

RUN cd /opt/sharedocs && npm install

RUN mkdir -p /var/sharedocs/upload
VOLUME /var/sharedocs/upload

EXPOSE 8080
CMD ["/opt/sharedocs/sharedocs", "run"]
16 changes: 16 additions & 0 deletions Dockerfile-db
@@ -0,0 +1,16 @@
FROM postgres:9.5

RUN apt-get update
RUN apt-get install -y task-japanese
RUN echo "ja_JP.UTF-8 UTF-8" >> /etc/locale.gen
RUN locale-gen
RUN update-locale LANG=ja_JP.UTF-8
RUN localedef -i ja_JP -c -f UTF-8 -A /usr/share/locale/locale.alias ja_JP.UTF-8

ENV LANG ja_JP.UTF-8

# exec DDL & DML
ADD src/main/resources/db/migration/*.sql /docker-entrypoint-initdb.d/

EXPOSE 5432
CMD ["postgres"]
19 changes: 19 additions & 0 deletions README.md
Expand Up @@ -15,6 +15,14 @@ or

[![Heroku Deploy](https://www.herokucdn.com/deploy/button.png)](https://heroku.com/deploy)

or

[<img src="https://www.docker.com/sites/default/files/legal/small_h-dark.png" height="40" />](https://www.docker.com/)

1. Install [<img src="https://www.docker.com/sites/default/files/legal/small_h-dark.png" height="40" />](https://www.docker.com/)
1. Run ```docker-compose up```
1. access [http://localhost:8080/](http://localhost:8080/)

## System Requirements
- Scala 2.11 or 2.12
- PostgreSQL 9.5.x or 9.6.x
Expand Down Expand Up @@ -167,6 +175,17 @@ CORS Configuration example:
</CORSConfiguration>
```

### Customize SharedocsEnv on docker environment
If you want customize SharedocsEnv. You can customize environment valiables in docker-compose.yml .

#### Example
* customize docker-compose.yml
```
app:
...
environment:
LOGIN_PERMITTED_EMAIL_DOMAINS: "yourcompany.co.jp"
```

## Lisence

Expand Down
37 changes: 37 additions & 0 deletions docker-compose.yml
@@ -0,0 +1,37 @@
version: '3'
services:
db:
build:
context: .
dockerfile: Dockerfile-db
volumes:
- sharedocs-db-data:/var/lib/postgresql/data
environment:
POSTGRES_USER: sharedocs
POSTGRES_PASSWORD: sharedocs
POSTGRES_DB: sharedocs
POSTGRES_INITDB_ARGS: "-E UTF8 -T template0 --lc-collate=ja_JP.UTF-8 --lc-ctype=ja_JP.UTF-8"
app:
build:
context: .
dockerfile: Dockerfile-app
ports:
- 8080:8080
links:
- db
volumes:
- sharedocs-app-upload:/var/sharedocs/upload
environment:
DATABASE_HOST: db:5432
DATABASE_DBNAME: sharedocs
DATABASE_USER: sharedocs
DATABASE_PASSWORD: sharedocs
SITE_NAME: Sharedocs:local
SITE_TITLE: Sharedocs
LOGIN_PROVIDOR: app
UPLOAD_DESTINATION: local
LOCAL_UPLOAD_BASE_DIR: /var/sharedocs/upload
LOCAL_UPLOAD_BASE_URL: /static/uploads
volumes:
sharedocs-db-data:
sharedocs-app-upload:

0 comments on commit 6937cec

Please sign in to comment.