|
1 | 1 | # squash-tm
|
| 2 | + |
| 3 | +## Configuration |
| 4 | + |
| 5 | +You may whant to set the following environment variables: |
| 6 | + |
| 7 | +DB_URL: jdbc:postgresql://DB-HOST:5432/DB-NAME |
| 8 | +DB_USERNAME: user-name |
| 9 | +DB_PASSWORD: your-password |
| 10 | +DB_DIALECT: org.hibernate.dialect.PostgreSQLDialect |
| 11 | +DB_DRIVER: org.postgresql.Driver |
| 12 | + |
| 13 | +Also there are a few locations you may whant to mount as volumes: |
| 14 | + |
| 15 | +``` |
| 16 | +/srv/squash-tm/tmp # Jetty tmp and work directory |
| 17 | +/srv/squash-tm/bundles # Bundles directory |
| 18 | +/srv/squash-tm/conf # Configurations directory |
| 19 | +/srv/squash-tm/logs # Log directory |
| 20 | +/srv/squash-tm/jettyhome # Jetty home directory |
| 21 | +/srv/squash-tm/luceneindexes # Lucene indexes directory |
| 22 | +/srv/squash-tm/plugins # Plugins directory |
| 23 | +``` |
| 24 | + |
| 25 | +## Preparation for the first run |
| 26 | + |
| 27 | +If you are going to use Postgres database you need to prepare DB and schema. |
| 28 | + |
| 29 | +Run bash command on this image/container. e.g: |
| 30 | + |
| 31 | +``` |
| 32 | +docker run --rm -it logicify/squash-tm /bin/bash |
| 33 | +``` |
| 34 | + |
| 35 | +and issue the following: |
| 36 | + |
| 37 | +``` |
| 38 | +psql -h <DBHOST HERE> --user $DB_USER $DB_NAME < ../database-scripts/postgresql-full-install-version-1.12.0.RELEASE.sql |
| 39 | +``` |
| 40 | + |
| 41 | +## Docker compose example |
| 42 | + |
| 43 | +Here is an example of the configuration using docker compose. Which starts an app on the port ```8012``` using external postgres databse (separate container): |
| 44 | + |
| 45 | +``` |
| 46 | +postgres: |
| 47 | + build: postgres:9.4.1 |
| 48 | + expose: |
| 49 | + - 5432 |
| 50 | + volumes: |
| 51 | + - ./data-postgres:/var/lib/postgresql/data |
| 52 | +
|
| 53 | +
|
| 54 | +squashtm: |
| 55 | + image: logicify/squash-tm:latest |
| 56 | + ports: |
| 57 | + - "8012:8080" |
| 58 | + environment: |
| 59 | + DB_URL: jdbc:postgresql://postgres:5432/squashtm |
| 60 | + DB_USERNAME: squashtm |
| 61 | + DB_PASSWORD: your-password |
| 62 | + DB_DIALECT: org.hibernate.dialect.PostgreSQLDialect |
| 63 | + DB_DRIVER: org.postgresql.Driver |
| 64 | + links: |
| 65 | + - postgres:postgres |
| 66 | +``` |
0 commit comments