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 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
|
||||
|
||||
|
@ -15,6 +15,9 @@ services:
|
||||
dwsurvey:
|
||||
image: dwsurvey
|
||||
restart: always
|
||||
volumes:
|
||||
- "dwsurvey-wjHtml:/dwsurvey/WEB-INF/wjHtml"
|
||||
- "dwsurvey-site:/dwsurvey/WEB-INF/classes/conf/site"
|
||||
links:
|
||||
- db
|
||||
environment:
|
||||
@ -30,3 +33,5 @@ services:
|
||||
|
||||
volumes:
|
||||
mysql-data: {}
|
||||
dwsurvey-wjHtml: {}
|
||||
dwsurvey-site: {}
|
||||
|
@ -2,6 +2,7 @@
|
||||
set -e
|
||||
|
||||
WAR_FILE=/diaowen.war
|
||||
UNPACK_DIR=/dwsurvey
|
||||
WEBAPP_BASE=$CATALINA_HOME/webapps
|
||||
|
||||
# determine context root path
|
||||
@ -32,8 +33,11 @@ init_run() {
|
||||
require_env MYSQL_PASSWORD
|
||||
|
||||
echo "Unpacking war ..."
|
||||
mkdir -p "$WEBAPP_DIR"
|
||||
unzip -q -x "$WAR_FILE" -d "$WEBAPP_DIR"
|
||||
mkdir -p "$UNPACK_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 ..."
|
||||
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