-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: run Zanata and DB via docker-compose (#548)
- Loading branch information
Showing
5 changed files
with
68 additions
and
1 deletion.
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
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,4 @@ | ||
FROM wildfly-zanata-base | ||
|
||
# Add the war file | ||
ADD ROOT.war /opt/jboss/wildfly/standalone/deployments/ |
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,33 @@ | ||
--- | ||
# TODO upgrade to version 2.1 after Fedora 27 is GA (when F25 is EOL) | ||
version: '2.0' | ||
services: | ||
zanatadb: | ||
image: mariadb:10.1 | ||
command: --character-set-server=utf8 --collation-server=utf8_general_ci | ||
environment: | ||
MYSQL_ROOT_PASSWORD: supersecret | ||
MYSQL_DATABASE: zanata | ||
MYSQL_USER: zanata | ||
MYSQL_PASSWORD: zanatapw | ||
volumes: | ||
- $HOME/docker-volumes/zanata-mariadb:/var/lib/mysql:Z | ||
# This requires docker-compose file version 2.1 | ||
# healthcheck: | ||
# test: ["CMD", "mysqladmin", "ping", "--silent"] | ||
zanata: | ||
# build: . | ||
image: zanata-dev | ||
links: | ||
- zanatadb | ||
environment: | ||
DB_HOSTNAME: zanatadb | ||
DB_NAME: zanata | ||
DB_USER: zanata | ||
DB_PASSWORD: zanatapw | ||
# TODO MAIL_HOST, MAIL_PORT, MAIL_USERNAME, MAIL_PASSWORD | ||
PREPEND_JAVA_OPTS: "-XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/opt/jboss/zanata" | ||
ports: | ||
- 8080:8080 | ||
volumes: | ||
- $HOME/docker-volumes/zanata:/opt/jboss/zanata:Z |
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
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,25 @@ | ||
#!/bin/bash | ||
|
||
# determine directory containing this script | ||
SOURCE="${BASH_SOURCE[0]}" | ||
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink | ||
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" | ||
SOURCE="$(realpath "$SOURCE")" | ||
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located | ||
done | ||
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" | ||
|
||
cd $DIR | ||
|
||
docker build --tag wildfly-zanata-base . | ||
|
||
# First transform flattens everything | ||
# Second transform renames the versioned zanata war to ROOT.war | ||
tar --create \ | ||
Dockerfile.zanata \ | ||
../zanata-war/target/zanata-*.war \ | ||
--transform 's,.*/,,' \ | ||
--transform 's/zanata-.*\.war/ROOT.war/' | | ||
docker build -t zanata-dev --file Dockerfile.zanata - | ||
|
||
docker-compose up |