mirror of
https://gitee.com/wkeyuan/DWSurvey.git
synced 2024-12-02 03:58:23 +08:00
docker: set volumes
This commit is contained in:
parent
d9c1911dcd
commit
8ad1cb7fac
@ -60,7 +60,8 @@ RUN apk add --no-cache mysql-client
|
|||||||
COPY --from=builder /DWSurvey/target/diaowen.war /diaowen.war
|
COPY --from=builder /DWSurvey/target/diaowen.war /diaowen.war
|
||||||
COPY docker-entry.sh /docker-entry.sh
|
COPY docker-entry.sh /docker-entry.sh
|
||||||
|
|
||||||
# TODO set volumes
|
# TODO this is a dirty hack
|
||||||
|
VOLUME ["/dwsurvey/WEB-INF/wjHtml", "/dwsurvey/WEB-INF/classes/conf/site"]
|
||||||
|
|
||||||
EXPOSE 8080
|
EXPOSE 8080
|
||||||
|
|
||||||
|
@ -15,6 +15,9 @@ services:
|
|||||||
dwsurvey:
|
dwsurvey:
|
||||||
image: dwsurvey
|
image: dwsurvey
|
||||||
restart: always
|
restart: always
|
||||||
|
volumes:
|
||||||
|
- "dwsurvey-wjHtml:/dwsurvey/WEB-INF/wjHtml"
|
||||||
|
- "dwsurvey-site:/dwsurvey/WEB-INF/classes/conf/site"
|
||||||
links:
|
links:
|
||||||
- db
|
- db
|
||||||
environment:
|
environment:
|
||||||
@ -30,3 +33,5 @@ services:
|
|||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
mysql-data: {}
|
mysql-data: {}
|
||||||
|
dwsurvey-wjHtml: {}
|
||||||
|
dwsurvey-site: {}
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
set -e
|
set -e
|
||||||
|
|
||||||
WAR_FILE=/diaowen.war
|
WAR_FILE=/diaowen.war
|
||||||
|
UNPACK_DIR=/dwsurvey
|
||||||
WEBAPP_BASE=$CATALINA_HOME/webapps
|
WEBAPP_BASE=$CATALINA_HOME/webapps
|
||||||
|
|
||||||
# determine context root path
|
# determine context root path
|
||||||
@ -32,8 +33,11 @@ init_run() {
|
|||||||
require_env MYSQL_PASSWORD
|
require_env MYSQL_PASSWORD
|
||||||
|
|
||||||
echo "Unpacking war ..."
|
echo "Unpacking war ..."
|
||||||
mkdir -p "$WEBAPP_DIR"
|
mkdir -p "$UNPACK_DIR"
|
||||||
unzip -q -x "$WAR_FILE" -d "$WEBAPP_DIR"
|
unzip -q -x "$WAR_FILE" -d "$UNPACK_DIR" \
|
||||||
|
-x "WEB-INF/wjHtml/*" \
|
||||||
|
-x "WEB-INF/classes/conf/site/*"
|
||||||
|
ln -snf "$UNPACK_DIR" "$WEBAPP_DIR"
|
||||||
|
|
||||||
echo "Configuring dwsurvey ..."
|
echo "Configuring dwsurvey ..."
|
||||||
sed -i "s^jdbc.url=.*\$jdbc.url=jdbc:mysql://${MYSQL_HOST}:${MYSQL_PORT}/${MYSQL_DATABASE}?useUnicode=true\&characterEncoding=utf8g;
|
sed -i "s^jdbc.url=.*\$jdbc.url=jdbc:mysql://${MYSQL_HOST}:${MYSQL_PORT}/${MYSQL_DATABASE}?useUnicode=true\&characterEncoding=utf8g;
|
||||||
|
Loading…
Reference in New Issue
Block a user