docker
This commit is contained in:
parent
796a82d777
commit
fa79c9ed10
28
Dockerfile
28
Dockerfile
@ -1,17 +1,33 @@
|
||||
FROM alpine:latest
|
||||
|
||||
ENV APP_VERSION=1.0.0 \
|
||||
APP_HOME=/service \
|
||||
APP_NAME=overflow_gateway_web
|
||||
APP_HOME=/service \
|
||||
APP_NAME=overflow_gateway_web \
|
||||
APP_CONF_PATH="/opt/conf" \
|
||||
PATH="$PATH:/opt/bin"
|
||||
|
||||
ADD dist/${APP_NAME} ${APP_HOME}/
|
||||
ADD _docker/bin/*.sh /opt/bin/
|
||||
|
||||
RUN apk add --no-cache curl \
|
||||
&& chmod +x /opt/bin/*.sh
|
||||
|
||||
ENV TINI_VERSION='0.15.0' \
|
||||
TINI_SHA='4007655082f573603c02bc1d2137443c8e153af047ffd088d02ccc01e6f06170'
|
||||
|
||||
# Use tini as subreaper in Docker container to adopt zombie processes
|
||||
RUN curl -fsSL https://github.com/krallin/tini/releases/download/v${TINI_VERSION}/tini-static-amd64 -o /bin/tini \
|
||||
&& chmod +x /bin/tini \
|
||||
&& echo "$TINI_SHA /bin/tini" | sha256sum -c -
|
||||
|
||||
WORKDIR ${APP_HOME}
|
||||
|
||||
ADD dist/${APP_NAME} ${APP_HOME}/
|
||||
ADD config.json ${APP_HOME}/
|
||||
|
||||
VOLUME ${APP_CONF_PATH}
|
||||
EXPOSE 80 443
|
||||
|
||||
ENTRYPOINT ["./overflow_service_websocket"]
|
||||
ENTRYPOINT ["/bin/tini", "--"]
|
||||
CMD ["docker-entrypoint.sh"]
|
||||
|
||||
|
||||
# docker build -f Dockerfile -t docker.loafle.net/overflow/overflow_service_websocket:1.0.0-alpine .
|
||||
# docker run -d -p 18081:80 -t docker.loafle.net/overflow/overflow_service_websocket:1.0.0-alpine
|
||||
|
9
_docker/bin/docker-entrypoint.sh
Normal file
9
_docker/bin/docker-entrypoint.sh
Normal file
@ -0,0 +1,9 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
cd /service
|
||||
|
||||
/usr/bin/java -classpath ${APP_CONF_PATH}/:${APP_FILENAME}:lib/* ${APP_MAIN_CLASS} 50006
|
||||
|
||||
exec "$@"
|
Loading…
x
Reference in New Issue
Block a user