Skip to content

Commit

Permalink
feat: extract 8081 port to arg
Browse files Browse the repository at this point in the history
  • Loading branch information
Yukaii committed May 27, 2022
1 parent c82311a commit fb9b812
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 3 additions & 2 deletions Dockerfile
@@ -1,4 +1,5 @@
ARG LANGUAGETOOL_VERSION=5.7
ARG PORT=8010

FROM debian:buster as build

Expand Down Expand Up @@ -59,8 +60,8 @@ COPY --chown=languagetool config.properties config.properties

USER languagetool

HEALTHCHECK --timeout=10s --start-period=5s CMD curl --fail --data "language=en-US&text=a simple test" http://localhost:8010/v2/check || exit 1
HEALTHCHECK --timeout=10s --start-period=5s CMD curl --fail --data "language=en-US&text=a simple test" http://localhost:$PORT/v2/check || exit 1

CMD [ "bash", "start.sh" ]

EXPOSE 8010
EXPOSE $PORT
6 changes: 5 additions & 1 deletion start.sh
Expand Up @@ -14,5 +14,9 @@ fi
Xms=${Java_Xms:-256m}
Xmx=${Java_Xmx:-512m}

if [ -z "$PORT" ]; then
export PORT=8081
fi

set -x
java -Xms$Xms -Xmx$Xmx -cp languagetool-server.jar org.languagetool.server.HTTPServer --port 8010 --public --allow-origin '*' --config config.properties
java -Xms$Xms -Xmx$Xmx -cp languagetool-server.jar org.languagetool.server.HTTPServer --port $PORT --public --allow-origin '*' --config config.properties

0 comments on commit fb9b812

Please sign in to comment.